Skip to content

Commit

Permalink
Random shuffle tests before splitting groups
Browse files Browse the repository at this point in the history
Signed-off-by: Heng Qian <[email protected]>
  • Loading branch information
qianheng-aws committed Nov 21, 2024
1 parent 14667b6 commit 146b672
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import scala.util.Random

import Dependencies.*

lazy val scala212 = "2.12.14"
Expand Down Expand Up @@ -284,7 +286,8 @@ lazy val integtest = (project in file("integ-test"))
IntegrationTest / testGrouping := {
val tests = (IntegrationTest / definedTests).value
val forkOptions = ForkOptions()
val groups = tests.grouped(tests.size / 3 + 1).zipWithIndex.map { case (group, index) =>
// Random shuffle the tests and split them into 3 groups
val groups = Random.shuffle(tests).grouped(tests.size / 3 + 1).zipWithIndex.map { case (group, index) =>
val groupName = s"group-${index + 1}"
new Tests.Group(
name = groupName,
Expand Down

0 comments on commit 146b672

Please sign in to comment.