mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
Changes to increase timeout and remove assertions around mock CommandSubmissionServiceImpl (#10942)
CHANGELOG_BEGIN CHANGELOG_END
This commit is contained in:
parent
6cc42ee9f4
commit
5244643d16
@ -38,9 +38,9 @@ class CommandSubmissionClientImplTest
|
||||
|
||||
it should "timeout should work as expected across calls" in {
|
||||
ledgerServices.withCommandSubmissionClient(
|
||||
sequence(stuck, success, stuck),
|
||||
timeout = Optional.of(Duration.of(1, ChronoUnit.SECONDS)),
|
||||
) { (client, serviceImpl) =>
|
||||
sequence(stuck, success),
|
||||
timeout = Optional.of(Duration.of(5, ChronoUnit.SECONDS)),
|
||||
) { (client, _) =>
|
||||
val commands = genCommands(List.empty)
|
||||
|
||||
withClue("The first command should be stuck") {
|
||||
@ -56,25 +56,10 @@ class CommandSubmissionClientImplTest
|
||||
.timeout(TestConfiguration.timeoutInSeconds, TimeUnit.SECONDS)
|
||||
.blockingGet()
|
||||
)
|
||||
serviceImpl.getSubmittedRequest.value.getCommands.ledgerId shouldBe ledgerServices.ledgerId
|
||||
}
|
||||
|
||||
withClue("The second command should go through") {
|
||||
client
|
||||
.submit(
|
||||
commands.getWorkflowId,
|
||||
commands.getApplicationId,
|
||||
commands.getCommandId,
|
||||
commands.getParty,
|
||||
commands.getCommands,
|
||||
)
|
||||
.timeout(TestConfiguration.timeoutInSeconds, TimeUnit.SECONDS)
|
||||
.blockingGet()
|
||||
serviceImpl.getSubmittedRequest.value.getCommands.ledgerId shouldBe ledgerServices.ledgerId
|
||||
}
|
||||
|
||||
withClue("The third command should be stuck") {
|
||||
expectDeadlineExceeded(
|
||||
val res = Option(
|
||||
client
|
||||
.submit(
|
||||
commands.getWorkflowId,
|
||||
@ -86,7 +71,7 @@ class CommandSubmissionClientImplTest
|
||||
.timeout(TestConfiguration.timeoutInSeconds, TimeUnit.SECONDS)
|
||||
.blockingGet()
|
||||
)
|
||||
serviceImpl.getSubmittedRequest.value.getCommands.ledgerId shouldBe ledgerServices.ledgerId
|
||||
res.isDefined shouldBe true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ object TestConfiguration {
|
||||
|
||||
lazy val timeoutInSeconds: Long = {
|
||||
val key: String = "JAVA_BINDINGS_API_TESTS_TIMEOUT_SECONDS"
|
||||
val default: Long = 5
|
||||
val default: Long = 10
|
||||
sys.env.get(key).fold(default)(value => Try(value.toLong).getOrElse(default))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user