From a3f8ccd924f4c8b6706372b500d3c6c0ce424954 Mon Sep 17 00:00:00 2001 From: Preston Van Loon Date: Tue, 1 Mar 2022 14:34:05 -0600 Subject: [PATCH] validator: Fix flaky test TestServer_RefreshJWTSecretOnFileChange (#10296) --- validator/rpc/auth_token_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/validator/rpc/auth_token_test.go b/validator/rpc/auth_token_test.go index 419f542e8..13d4f17a6 100644 --- a/validator/rpc/auth_token_test.go +++ b/validator/rpc/auth_token_test.go @@ -71,6 +71,9 @@ func TestServer_RefreshJWTSecretOnFileChange(t *testing.T) { defer cancel() go srv.refreshAuthTokenFromFileChanges(ctx, authTokenPath) + // Wait for service to be ready. + time.Sleep(time.Millisecond * 250) + // Update the auth token file with a new secret. require.NoError(t, CreateAuthToken(walletDir, "localhost:7500"))