Skip to content

Commit 39453d2

Browse files
F-OBrienclaude
andcommitted
fix: widen the controllerTransfer pending-instruction poll
The last CI run reached 250 of 257 tests passing, with this the only genuine failure: "the counter party should have the instruction as pending". Blocks are 6s on the runner, measured over 322 blocks of the run, so the 10 x 2s retry window covered only about three of them. The counter party's pending list comes from the middleware, which lags the chain further under load, and three blocks was not reliably enough with eight workers competing. Its sibling in sdk/settlements/tradeAssets.ts does the same lookup with no retry at all and passes, so this is a timing margin rather than a logic fault. Poll for 30 attempts instead, covering ten blocks, still well inside the 50 block (~300s) validity getPendingInstructionEndBlock allows. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 5b3f177 commit 39453d2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tests/src/sdk/assets/controllerTransfer.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@ export const fungibleAssetControllerTransfer = async (
4949
await awaitMiddlewareSynced(transferTx, sdk, 30, 3000);
5050

5151
// affirm instruction
52+
//
53+
// Blocks are 6s, so the old 10 x 2s window only covered about three of them.
54+
// The counter party's pending list is served by the middleware, which lags
55+
// the chain further under load, and on a busy CI runner three blocks was not
56+
// reliably enough. 30 attempts covers ten blocks, still far inside the ~300s
57+
// (50 block) validity `getPendingInstructionEndBlock` gives the instruction.
5258
let counterInstruction;
53-
for (let attempt = 0; attempt < 10; attempt++) {
59+
for (let attempt = 0; attempt < 30; attempt++) {
5460
const { pending } = await counterParty.getInstructions();
5561
counterInstruction = pending.find(({ id }) => id.eq(instruction.id));
5662
if (counterInstruction) {

0 commit comments

Comments
 (0)