Skip to content

Commit 902e5be

Browse files
committed
TUN-6729: Fix flaky TestClosePreviousProxies
I can only reproduce the flakiness, which is the hello world still responding when it should be shut down already, in Windows (both in TeamCity as well as my local VM). Locally, it only happens when the machine is under high load. Anyway, it's valid that the proxies take some time to shut down since they handle that via channels asynchronously with regards to the event that updates the configuration. Hence, nothing is wrong, as long as they eventually shut down, which the test still verifies.
1 parent 7ca5f75 commit 902e5be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

orchestration/orchestrator_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,8 @@ func TestClosePreviousProxies(t *testing.T) {
500500
require.NoError(t, err)
501501
require.Equal(t, http.StatusTeapot, resp.StatusCode)
502502

503-
// The hello-world server in config v1 should have been stopped
503+
// The hello-world server in config v1 should have been stopped. We wait a bit since it's closed asynchronously.
504+
time.Sleep(time.Millisecond * 10)
504505
resp, err = proxyHTTP(originProxyV1, hostname)
505506
require.Error(t, err)
506507
require.Nil(t, resp)

0 commit comments

Comments
 (0)