Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Infra] [Spark] Improve delta-spark test assignment / distribution among CI Shards / Groups [Attempt 3] #3719

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions project/TestParallelization.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import scala.util.hashing.MurmurHash3

import sbt.Keys._
import sbt._

Expand Down Expand Up @@ -146,13 +148,14 @@ object TestParallelization {
}

val testIsAssignedToShard =
math.abs(testDefinition.name.hashCode % numShards.get) == shardId.get
math.abs(MurmurHash3.stringHash(testDefinition.name) % numShards.get) == shardId.get

if(!testIsAssignedToShard) {
return new SimpleHashStrategy(groups, shardId)
}
}

val groupIdx = math.abs(testDefinition.name.hashCode % groupCount)
val groupIdx = math.abs(MurmurHash3.stringHash(testDefinition.name) % groupCount)
val currentGroup = groups(groupIdx)
val updatedGroup = currentGroup.withTests(
currentGroup.tests :+ testDefinition
Expand Down
Loading