Skip to content

Agent Mesh

test(node): fix StartRenewalLoop race condition in crash test

Antonio Ojea9c0fd2a5bfdc
diff --git a/cmd/sam-node/node_test.go b/cmd/sam-node/node_test.go
index 611cc29d..c60e79ea 100644
--- a/cmd/sam-node/node_test.go
+++ b/cmd/sam-node/node_test.go
@@ -82,7 +82,7 @@ func TestStartRenewalLoop_ExpiredAndFails(t *testing.T) {
// Run the renewal loop. Since there's no JWT/Issuer provided, it fails to renew.
// It will see that it's expired and it failed to renew, so it will log.Fatalf
node.StartRenewalLoop(context.Background(), "", "", "", "")
- time.Sleep(500 * time.Millisecond)
+ time.Sleep(2 * time.Second)
os.Exit(0) // should not be reached
return
}