@@ -14,6 +14,7 @@ import {
14
14
import { execFileSync } from 'node:child_process' ;
15
15
import { agdWalletUtils } from './test-lib/index.js' ;
16
16
import { getBalances , replaceTemplateValuesInFile } from './test-lib/utils.js' ;
17
+ import { tryISTBalances } from './test-lib/psm-lib.js' ;
17
18
18
19
/**
19
20
* @param {string } file
@@ -57,10 +58,12 @@ test.serial(`send invitation via namesByAddress`, async t => {
57
58
) ;
58
59
} ) ;
59
60
60
- // FIXME https://github.com/Agoric/agoric-sdk/issues/10565
61
- test . skip ( 'exitOffer tool reclaims stuck payment' , async t => {
61
+ test . serial ( 'exitOffer tool reclaims stuck payment' , async t => {
62
62
const istBalanceBefore = await getBalances ( [ GOV1ADDR ] , 'uist' ) ;
63
- t . log ( 'istBalanceBefore' , istBalanceBefore ) ;
63
+
64
+ // Using console.log here because t.log is inconsistent
65
+ // when a test fails in CI. See https://github.com/Agoric/agoric-sdk/issues/10565#issuecomment-2561923537
66
+ console . log ( 'istBalanceBefore' , istBalanceBefore ) ;
64
67
65
68
const offerId = 'bad-invitation-15' ; // offer submitted on proposal upgrade-15 with an incorrect method name
66
69
await agdWalletUtils . broadcastBridgeAction ( GOV1ADDR , {
@@ -70,16 +73,20 @@ test.skip('exitOffer tool reclaims stuck payment', async t => {
70
73
71
74
const istBalanceAfter = await retryUntilCondition (
72
75
async ( ) => getBalances ( [ GOV1ADDR ] , 'uist' ) ,
73
- istBalance => istBalance > istBalanceBefore ,
74
- 'tryExitOffer failed to reclaim stuck payment ' ,
76
+ // We only check gov1's IST balance is changed.
77
+ // Because the reclaimed amount (0,015 IST) is less than execution fee (0,2 IST)
78
+ // we might end up with less IST than the one before reclaiming the stuck payment.
79
+ istBalance => istBalance !== istBalanceBefore ,
80
+ 'tryExitOffer did not end up changing the IST balance' ,
75
81
{ log : t . log , setTimeout, retryIntervalMs : 5000 , maxRetries : 15 } ,
76
82
) ;
77
83
78
- t . log ( 'istBalanceAfter' , istBalanceAfter ) ;
84
+ console . log ( 'istBalanceAfter' , istBalanceAfter ) ;
79
85
80
- t . true (
81
- istBalanceAfter > istBalanceBefore ,
82
- 'The IST balance should increase after reclaiming the stuck payment' ,
86
+ await tryISTBalances (
87
+ t ,
88
+ Number ( istBalanceAfter ) ,
89
+ Number ( istBalanceBefore + 15_000n ) ,
83
90
) ;
84
91
} ) ;
85
92
0 commit comments