commit 52f38f9efb295b80f5ec46e1e138f8a93d1963f1
parent 30dfc0d2a2e2951f1e347573286e7ee5486780fd
Author: Antoine A <>
Date: Sat, 7 Mar 2026 20:01:42 +0100
common: relax polling timeout reactivity in tests
Diffstat:
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/libeufin-bank/src/test/kotlin/routines.kt b/libeufin-bank/src/test/kotlin/routines.kt
@@ -1,6 +1,6 @@
/*
* This file is part of LibEuFin.
- * Copyright (C) 2023-2024 Taler Systems S.A.
+ * Copyright (C) 2023, 2024, 2026 Taler Systems S.A.
* LibEuFin is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -113,7 +113,7 @@ suspend inline fun <reified B> ApplicationTestBuilder.statusRoutine(
.taler_withdraw_uri.split("/").last()
// Check no useless polling
- assertTime(0, 100) {
+ assertTime(0, 500) {
client.get("$url/$confirmed_uuid?timeout_ms=1000&old_state=selected")
.assertOkJson<B> { assertEquals(WithdrawalStatus.pending, status(it)) }
}
@@ -121,13 +121,13 @@ suspend inline fun <reified B> ApplicationTestBuilder.statusRoutine(
// Polling selected
coroutineScope {
launch { // Check polling succeed
- assertTime(100, 200) {
+ assertTime(100, 500) {
client.get("$url/$confirmed_uuid?timeout_ms=1000")
.assertOkJson<B> { assertEquals(WithdrawalStatus.selected, status(it)) }
}
}
launch { // Check polling succeed
- assertTime(100, 200) {
+ assertTime(100, 500) {
client.get("$url/$aborted_uuid?timeout_ms=1000")
.assertOkJson<B> { assertEquals(WithdrawalStatus.selected, status(it)) }
}
@@ -140,13 +140,13 @@ suspend inline fun <reified B> ApplicationTestBuilder.statusRoutine(
// Polling confirmed
coroutineScope {
launch { // Check polling succeed
- assertTime(100, 200) {
+ assertTime(100, 500) {
client.get("$url/$confirmed_uuid?timeout_ms=1000&old_state=selected")
.assertOkJson<B> { assertEquals(WithdrawalStatus.confirmed, status(it))}
}
}
launch { // Check polling timeout
- assertTime(200, 300) {
+ assertTime(200, 500) {
client.get("$url/$aborted_uuid?timeout_ms=200&old_state=selected")
.assertOkJson<B> { assertEquals(WithdrawalStatus.selected, status(it)) }
}
@@ -158,13 +158,13 @@ suspend inline fun <reified B> ApplicationTestBuilder.statusRoutine(
// Polling abort
coroutineScope {
launch {
- assertTime(200, 300) {
+ assertTime(200, 500) {
client.get("$url/$confirmed_uuid?timeout_ms=200&old_state=confirmed")
.assertOkJson<B> { assertEquals(WithdrawalStatus.confirmed, status(it))}
}
}
launch {
- assertTime(100, 200) {
+ assertTime(100, 500) {
client.get("$url/$aborted_uuid?timeout_ms=1000&old_state=selected")
.assertOkJson<B> { assertEquals(WithdrawalStatus.aborted, status(it)) }
}
diff --git a/libeufin-common/src/main/kotlin/test/routines.kt b/libeufin-common/src/main/kotlin/test/routines.kt
@@ -1,6 +1,6 @@
/*
* This file is part of LibEuFin.
- * Copyright (C) 2024 Taler Systems S.A.
+ * Copyright (C) 2024, 2026 Taler Systems S.A.
* LibEuFin is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@@ -64,12 +64,12 @@ suspend inline fun <reified B> abstractHistoryRoutine(
if (polling) {
// Check no polling when we cannot have more transactions
- assertTime(0, 100) {
+ assertTime(0, 500) {
history("limit=-${nbRegistered+1}&timeout_ms=1000")
.assertHistory(nbRegistered)
}
// Check no polling when already find transactions even if less than delta
- assertTime(0, 100) {
+ assertTime(0, 500) {
history("limit=${nbRegistered+1}&timeout_ms=1000")
.assertHistory(nbRegistered)
}
@@ -78,13 +78,13 @@ suspend inline fun <reified B> abstractHistoryRoutine(
coroutineScope {
val id = latestId()
launch { // Check polling succeed
- assertTime(100, 200) {
+ assertTime(100, 500) {
history("limit=2&offset=$id&timeout_ms=1000")
.assertHistory(1)
}
}
launch { // Check polling timeout
- assertTime(200, 300) {
+ assertTime(200, 500) {
history("limit=1&offset=${id+nbTotal*3}&timeout_ms=200")
.assertNoContent()
}
@@ -98,7 +98,7 @@ suspend inline fun <reified B> abstractHistoryRoutine(
coroutineScope {
val id = latestId()
launch {
- assertTime(100, 200) {
+ assertTime(100, 500) {
history("limit=7&offset=$id&timeout_ms=1000")
.assertHistory(1)
}
@@ -112,7 +112,7 @@ suspend inline fun <reified B> abstractHistoryRoutine(
coroutineScope {
val id = latestId()
launch {
- assertTime(200, 300) {
+ assertTime(200, 500) {
history("limit=7&offset=$id&timeout_ms=200")
.assertNoContent()
}