Skip to content

Commit 2106068

Browse files
Fix flaky PlanLifecycle test: retry LCD balance check after connect
The GetBalanceAsync call after VPN connect occasionally hits LCD endpoint timeout. Added single retry with 5s delay.
1 parent 26a8cb6 commit 2106068

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

tests/Sentinel.SDK.Tests/PlanLifecycleTests.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,18 @@ public async Task FullPlanLifecycle_SubscribeGrantConnect()
147147
Assert.False(string.IsNullOrEmpty(conn.SessionId));
148148

149149
// Check user balance — fee grant should have covered gas
150-
var userBalAfter = await userChain.GetBalanceAsync(userWallet.Address);
150+
// Retry once on LCD failure (known flaky endpoint issue)
151+
Balance userBalAfter;
152+
try
153+
{
154+
userBalAfter = await userChain.GetBalanceAsync(userWallet.Address);
155+
}
156+
catch
157+
{
158+
_output.WriteLine($" Balance check failed, retrying after 5s...");
159+
await Task.Delay(5000);
160+
userBalAfter = await userChain.GetBalanceAsync(userWallet.Address);
161+
}
151162
_output.WriteLine($" User balance after: {Helpers.FormatP2P(userBalAfter.Udvpn)}");
152163

153164
// ─── 8. Disconnect ───

0 commit comments

Comments
 (0)