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 {
|
it should "timeout should work as expected across calls" in {
|
||||||
ledgerServices.withCommandSubmissionClient(
|
ledgerServices.withCommandSubmissionClient(
|
||||||
sequence(stuck, success, stuck),
|
sequence(stuck, success),
|
||||||
timeout = Optional.of(Duration.of(1, ChronoUnit.SECONDS)),
|
timeout = Optional.of(Duration.of(5, ChronoUnit.SECONDS)),
|
||||||
) { (client, serviceImpl) =>
|
) { (client, _) =>
|
||||||
val commands = genCommands(List.empty)
|
val commands = genCommands(List.empty)
|
||||||
|
|
||||||
withClue("The first command should be stuck") {
|
withClue("The first command should be stuck") {
|
||||||
@ -56,25 +56,10 @@ class CommandSubmissionClientImplTest
|
|||||||
.timeout(TestConfiguration.timeoutInSeconds, TimeUnit.SECONDS)
|
.timeout(TestConfiguration.timeoutInSeconds, TimeUnit.SECONDS)
|
||||||
.blockingGet()
|
.blockingGet()
|
||||||
)
|
)
|
||||||
serviceImpl.getSubmittedRequest.value.getCommands.ledgerId shouldBe ledgerServices.ledgerId
|
|
||||||
}
|
}
|
||||||
|
|
||||||
withClue("The second command should go through") {
|
withClue("The second command should go through") {
|
||||||
client
|
val res = Option(
|
||||||
.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(
|
|
||||||
client
|
client
|
||||||
.submit(
|
.submit(
|
||||||
commands.getWorkflowId,
|
commands.getWorkflowId,
|
||||||
@ -86,7 +71,7 @@ class CommandSubmissionClientImplTest
|
|||||||
.timeout(TestConfiguration.timeoutInSeconds, TimeUnit.SECONDS)
|
.timeout(TestConfiguration.timeoutInSeconds, TimeUnit.SECONDS)
|
||||||
.blockingGet()
|
.blockingGet()
|
||||||
)
|
)
|
||||||
serviceImpl.getSubmittedRequest.value.getCommands.ledgerId shouldBe ledgerServices.ledgerId
|
res.isDefined shouldBe true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ object TestConfiguration {
|
|||||||
|
|
||||||
lazy val timeoutInSeconds: Long = {
|
lazy val timeoutInSeconds: Long = {
|
||||||
val key: String = "JAVA_BINDINGS_API_TESTS_TIMEOUT_SECONDS"
|
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))
|
sys.env.get(key).fold(default)(value => Try(value.toLong).getOrElse(default))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user