Skip to content

Commit

Permalink
Merge pull request #349 from takahirom/takahirom/improve-performance-…
Browse files Browse the repository at this point in the history
…for-race-condition-workaround/2024-05-06

Improve performance for race condition workaround2
  • Loading branch information
takahirom authored May 6, 2024
2 parents 13d30e7 + 87239d9 commit 4ab61f7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,14 @@ abstract class RoborazziPlugin : Plugin<Project> {
}
finalizeTestTask.doLast {
val taskSkipEventsService = testTaskSkipEventsServiceProvider.get()
val buildFinishCountDownLatch = taskSkipEventsService.countDownLatch
val currentIsTestSkipped =
taskSkipEventsService.skippedTestTaskMap[taskPath + testTaskName]
val isTestSkipped = if (currentIsTestSkipped == null) {
// BuildService could cause race condition
// https://github.com/gradle/gradle/issues/24887
finalizeTestTask.infoln("Roborazzi: roborazziTestFinalizer.doLast test task result doesn't exits. currentIsTestSkipped:$currentIsTestSkipped currentTimeMillis:${System.currentTimeMillis()}")
val waitSuccess = taskSkipEventsService.countDownLatch.await(200, TimeUnit.MILLISECONDS)
val waitSuccess = buildFinishCountDownLatch.await(200, TimeUnit.MILLISECONDS)
val new =
taskSkipEventsService.skippedTestTaskMap[taskPath + testTaskName]
finalizeTestTask.infoln("Roborazzi: roborazziTestFinalizer.doLast wait end currentIsTestSkipped:$currentIsTestSkipped new:$new waitSuccess:$waitSuccess currentTimeMillis:${System.currentTimeMillis()}")
Expand Down

0 comments on commit 4ab61f7

Please sign in to comment.