From 63243bb5454e19be47f61b6f2a3b0b9342478054 Mon Sep 17 00:00:00 2001 From: Nick Ethier Date: Sat, 21 Jan 2023 00:37:36 -0500 Subject: [PATCH] remove racy assertions --- agent/hcp/scada/watchdog_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/agent/hcp/scada/watchdog_test.go b/agent/hcp/scada/watchdog_test.go index ee59392103..2e2f2951a0 100644 --- a/agent/hcp/scada/watchdog_test.go +++ b/agent/hcp/scada/watchdog_test.go @@ -76,6 +76,7 @@ func Test_watchdogProvider(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() tc := _tc + ms := time.Duration(len(tc.states)+1) * testInterval provider := NewMockProvider(t) wd := &watchdogProvider{ Provider: provider, @@ -98,12 +99,8 @@ func Test_watchdogProvider(t *testing.T) { provider.EXPECT().Start().Return(nil).Times(tc.expectedStartCalls) provider.EXPECT().Stop().Return(nil).Once() - require.False(t, wd.running) require.NoError(t, wd.Start()) - require.True(t, wd.running) - ms := time.Duration(len(tc.states)+1) * testInterval <-time.After(ms) - require.False(t, wd.running) require.ErrorIs(t, wd.Stop(), libscada.ErrProviderNotStarted) }) }