Skip to content

Commit

Permalink
Mitigate race in wslinstance's TestConnected (#279)
Browse files Browse the repository at this point in the history
There is a home-cooked version of `Eventually`. These kind of checks are
never reace-safe, you can only increase your confidence by increasing
timeouts.

Since Github machines seem to run quite a bit slower than my local dev
machine, I sometimes underestimate the length of timeouts. Hopefully
this is the case here.

---

UDENG-1382
  • Loading branch information
EduardGomezEscandell authored Sep 15, 2023
2 parents 1bbf096 + 9bfb02e commit 1c7be7e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ func stopWSLClientOnMatchingStep(wantStopStep, currentStep step, wsl *wslDistroM
func checkConnectedStatus(t *testing.T, wantDoneStep step, wantErr bool, currentStep step, srv wrappedService) (continueTest bool) {
t.Helper()

connectedErr, stopped := srv.wait(100 * time.Millisecond)
connectedErr, stopped := srv.wait(300 * time.Millisecond)
if currentStep != wantDoneStep {
require.False(t, stopped, "Connect() function should still be running at step %q but is has now stopped (should stop at step %q)", currentStep, wantDoneStep)
return true
Expand Down

0 comments on commit 1c7be7e

Please sign in to comment.