mirror of
https://github.com/sbt/sbt.git
synced 2026-09-04 16:54:29 +02:00
Restore string cancellation test
The cancel on-going task with string id test was failing in CI because of a race condition involving server log messages. We need to wait for a notification that the project has been compiled before we wait for the "Waiting for" message, otherwise we might pick up the "Waiting for" message from the previous test case and try to cancel the task before it has been created.
This commit is contained in:
@@ -54,6 +54,9 @@ object EventsTest extends AbstractServerTest {
|
||||
svr.sendJsonRpc(
|
||||
s"""{ "jsonrpc": "2.0", "id":$id, "method": "sbt/exec", "params": { "commandLine": "run" } }"""
|
||||
)
|
||||
assert(svr.waitForString(10.seconds) { s =>
|
||||
s contains "Compiled events"
|
||||
})
|
||||
assert(svr.waitForString(10.seconds) { s =>
|
||||
s contains "Waiting for"
|
||||
})
|
||||
@@ -66,13 +69,15 @@ object EventsTest extends AbstractServerTest {
|
||||
})
|
||||
}
|
||||
|
||||
/* This test is timing out.
|
||||
test("cancel on-going task with string id") { _ =>
|
||||
import sbt.Exec
|
||||
val id = Exec.newExecId
|
||||
svr.sendJsonRpc(
|
||||
s"""{ "jsonrpc": "2.0", "id": "$id", "method": "sbt/exec", "params": { "commandLine": "run" } }"""
|
||||
)
|
||||
assert(svr.waitForString(10.seconds) { s =>
|
||||
s contains "Compiled events"
|
||||
})
|
||||
assert(svr.waitForString(10.seconds) { s =>
|
||||
s contains "Waiting for"
|
||||
})
|
||||
@@ -84,5 +89,4 @@ object EventsTest extends AbstractServerTest {
|
||||
s contains """"result":{"status":"Task cancelled""""
|
||||
})
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user