Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 2c210ed

Browse files
committed
Fix unstable tests related to relayoutAllNodes in ASTableViewTests
- After constrained sizes of nodes were changed (for example because the table view width was changed) and before relayoutAllNodes operation will be executed, if there is any measuring tasks being executed in background, the new sizes will be used immediately. Therefore, by the time relayoutAllNodes is performed, some nodes already have up-to-date layouts and don't need to remeasure (on main). - As a result, after relayoutAllNodes is completed, the maximum number of layout pass performed on main thread for each node is between 0 and 1. ASTableViewTests is updated to assert this behaviour.
1 parent 1b500e4 commit 2c210ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

AsyncDisplayKitTests/ASTableViewTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ - (void)triggerSizeChangeAndAssertRelayoutAllRowsForTableView:(ASTableView *)tab
423423
for (int row = 0; row < NumberOfRowsPerSection; row++) {
424424
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section];
425425
ASTestTextCellNode *node = (ASTestTextCellNode *)[tableView nodeForRowAtIndexPath:indexPath];
426-
XCTAssertEqual(node.numberOfLayoutsOnMainThread, 1);
426+
XCTAssertLessThanOrEqual(node.numberOfLayoutsOnMainThread, 1);
427427
XCTAssertEqual(node.constrainedSizeForCalculatedLayout.max.width, newSize.width);
428428
}
429429
}

0 commit comments

Comments
 (0)