Skip to content

Commit

Permalink
change artifact and file name
Browse files Browse the repository at this point in the history
  • Loading branch information
scottsand-db committed Sep 20, 2024
1 parent 257715f commit 218fe78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/spark_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
shard: [0, 1, 2]
env:
SCALA_VERSION: ${{ matrix.scala }}
SHARD_NUM: ${{ matrix.shard }}
# Important: This must be the same as the length of shards in matrix
NUM_SHARDS: 3
steps:
Expand Down Expand Up @@ -89,6 +90,5 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-DSL-${{ matrix.scala }}-shard-${{ matrix.shard }}-run-${{ github.run_id }}-attempt-${{ github.run_attempt }}
path: |
test_results_*.csv
name: test-results-DSL-${{ matrix.scala }}-run-${{ github.run_id }}-attempt-${{ github.run_attempt }}
path: test_results_*.csv
9 changes: 6 additions & 3 deletions project/TestTimeListener.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ object TestTimeListener extends TestReportListener {
/** testSuite -> Seq[(testName, duration, result)] */
private val testResults = new ConcurrentHashMap[String, Seq[(String, Long, String)]]()

/** Generate a unique file name per JVM using process ID and timestamp */
private val jvmId = ManagementFactory.getRuntimeMXBean().getName.split("@")(0)
private val individualTestCsvPath = s"test_results_${jvmId}_${System.currentTimeMillis()}.csv"
/** Generate a unique file name per JVM using process ID and shard number */
private val individualTestCsvPath = {
val shardNumber = sys.env.getOrElse("SHARD_NUM", "0")
val jvmId = ManagementFactory.getRuntimeMXBean().getName.split("@")(0)
s"test_results_shard_${shardNumber}_jvm_${jvmId}.csv"
}

/** Lock to ensure only one thread writes to a file at a time within this JVM */
private val writeLock = new ReentrantLock()
Expand Down

0 comments on commit 218fe78

Please sign in to comment.