Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
scottsand-db committed Sep 24, 2024
1 parent a8cc4b4 commit 49fbec1
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit 49fbec1

Please sign in to comment.