Skip to content

Commit aaf6ed4

Browse files
committed
Make console/SIGINT test deterministic
Leverage the blocking server instead of relying on a long running operation.
1 parent 47cb783 commit aaf6ed4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

platforms/core-runtime/logging/src/integTest/groovy/org/gradle/internal/logging/console/TaskbarProgressResetFunctionalTest.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,24 @@ class TaskbarProgressResetFunctionalTest extends AbstractIntegrationSpec {
6161
buildFile << """
6262
task block {
6363
doFirst {
64-
Thread.sleep(10_000)
64+
${server.callFromBuild("block")}
6565
}
6666
}
6767
"""
68+
def block = server.expectAndBlock("block")
6869

6970
when:
7071
def gradle = executer.withTasks("block").start()
7172

73+
block.waitForAllPendingCalls()
7274
// Wait until the progress bar has started emitting OSC 9;4 sequences.
7375
ConcurrentTestUtil.poll {
7476
assert gradle.standardOutput.contains(OSC_PROGRESS_PREFIX)
7577
}
7678

7779
gradle.sendSignal(SIGINT)
7880
gradle.waitForFailure()
81+
block.releaseAll()
7982

8083
then:
8184
gradle.standardOutput.contains(OSC_RESET)

0 commit comments

Comments
 (0)