commit | 7da53a55616966c8c5837a2f35384789a2612727 | [log] [tgz] |
---|---|---|
author | George Mount <[email protected]> | Thu Oct 24 15:46:00 2024 -0700 |
committer | George Mount <[email protected]> | Thu Oct 24 16:31:48 2024 -0700 |
tree | 58131387cd2ca87bb0b9428e7f471bc47f6f7210 | |
parent | 28772a32096e8e20bcc1de27502d9c870707be57 [diff] |
Fix flaky testContextualFlowRow_equalHeight_worksWithWeight test Fixes: 364279302 The test used a random number between 1 and 200 and occasionally would end up with the same value between rows. The test has been modified to ensure the heights differ between rows. Test: replayed test 300 times on FTL Change-Id: Id2fcc76df8c528363cf16d3610a5f9c929fedb0d
diff --git a/compose/foundation/foundation-layout/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/layout/ContextualFlowRowColumnTest.kt b/compose/foundation/foundation-layout/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/layout/ContextualFlowRowColumnTest.kt index 3aa9880..086f752 100644 --- a/compose/foundation/foundation-layout/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/layout/ContextualFlowRowColumnTest.kt +++ b/compose/foundation/foundation-layout/src/androidInstrumentedTest/kotlin/androidx/compose/foundation/layout/ContextualFlowRowColumnTest.kt
@@ -545,7 +545,7 @@ horizontalArrangement = Arrangement.spacedBy(10.dp), verticalArrangement = Arrangement.spacedBy(20.dp), maxItemsInEachRow = 3, - ) { + ) { index -> Box( Modifier.onSizeChanged { listOfHeights.add(it.height) } .width(100.dp) @@ -553,7 +553,7 @@ .background(Color.Green) .fillMaxRowHeight() ) { - val height = Random.Default.nextInt(1, 200) - it + val height = 200 - index Box(modifier = Modifier.height(height.dp)) } }