From f0c4338ded75c6c93f1c7bc9d3058e50d7d9a0ee Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Thu, 5 Jun 2025 18:28:20 +1000 Subject: [PATCH] fix(integration): Increase poll interval on codex client calls To hopefully prevent the http client from crashing in CI --- tests/integration/testmarketplace.nim | 9 +++++++-- tests/integration/testpurchasing.nim | 8 ++++++-- tests/integration/testsales.nim | 4 +++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/integration/testmarketplace.nim b/tests/integration/testmarketplace.nim index f881a6ae..b7a6791f 100644 --- a/tests/integration/testmarketplace.nim +++ b/tests/integration/testmarketplace.nim @@ -178,7 +178,7 @@ marketplacesuite "Marketplace": let requestId = (await client0.client.requestId(purchaseId)).get # We wait that the 3 slots are filled by the first SP - check eventually( + check eventuallySafe( await client0.client.purchaseStateIs(purchaseId, "started"), timeout = 10 * 60.int * 1000, ) @@ -209,10 +209,13 @@ marketplacesuite "Marketplace": check eventually( await client0.client.purchaseStateIs(purchaseId2, "started"), timeout = 10 * 60.int * 1000, + pollInterval = 100, ) # Double check, verify that our second SP hosts the 3 slots - check eventually ((await provider1.client.getSlots()).get).len == 3 + check eventually ( + ((await provider1.client.getSlots()).get).len == 3, pollInterval = 100 + ) marketplacesuite "Marketplace payouts": const minPricePerBytePerSecond = 1.u256 @@ -380,6 +383,7 @@ marketplacesuite "Marketplace payouts": check eventually( await client0.client.purchaseStateIs(purchaseId, "started"), timeout = 10 * 60.int * 1000, + pollInterval = 100, ) # Here we will check that for each provider, the total remaining collateral @@ -398,4 +402,5 @@ marketplacesuite "Marketplace payouts": availability.totalRemainingCollateral == availableSlots * slotSize * minPricePerBytePerSecond, timeout = 30 * 1000, + pollInterval = 100 ) diff --git a/tests/integration/testpurchasing.nim b/tests/integration/testpurchasing.nim index ba8dd190..227df02e 100644 --- a/tests/integration/testpurchasing.nim +++ b/tests/integration/testpurchasing.nim @@ -95,13 +95,17 @@ twonodessuite "Purchasing": ) ).get check eventually( - await client1.purchaseStateIs(id, "submitted"), timeout = 3 * 60 * 1000 + await client1.purchaseStateIs(id, "submitted"), + timeout = 3 * 60 * 1000, + pollInterval = 100, ) await node1.restart() check eventually( - await client1.purchaseStateIs(id, "submitted"), timeout = 3 * 60 * 1000 + await client1.purchaseStateIs(id, "submitted"), + timeout = 3 * 60 * 1000, + pollInterval = 100, ) let request = (await client1.getPurchase(id)).get.request.get check request.ask.duration == (10 * 60).uint64 diff --git a/tests/integration/testsales.nim b/tests/integration/testsales.nim index ce32a3ef..6a908e84 100644 --- a/tests/integration/testsales.nim +++ b/tests/integration/testsales.nim @@ -218,7 +218,9 @@ multinodesuite "Sales": ).get check eventually( - await client.purchaseStateIs(id, "started"), timeout = 10 * 60 * 1000 + await client.purchaseStateIs(id, "started"), + timeout = 10 * 60 * 1000, + pollInterval = 100, ) let purchase = (await client.getPurchase(id)).get check purchase.error == none string