Skip to content

Commit 11f8167

Browse files
committed
prevent race condition in health check test by setting environment before tests
1 parent d757b79 commit 11f8167

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

broker/stores/health_check_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ func (errorReader) Read([]byte) (int, error) {
2525
func TestHealthChecks(t *testing.T) {
2626
const testContent = "health-check\n"
2727

28+
ForceStoreHealthCheckToHealthy = false
29+
2830
// Channel to coordinate the "Failure Then Success" test
2931
var failureThenSuccessCh = make(chan struct{})
3032

@@ -199,8 +201,6 @@ func TestHealthChecks(t *testing.T) {
199201
"s3": tt.setupStore(server),
200202
})
201203

202-
ForceStoreHealthCheckToHealthy = false
203-
204204
// Get store - this starts health check
205205
store := Get(pb.FragmentStore("s3://test/"))
206206
require.NoError(t, store.initErr)

0 commit comments

Comments
 (0)