chore(test) fix flaky tests (#6315)
* internal/cmd/commands/server/listener_reload_test.go remove t.Parallel() comment * internal/cmd/commands/server/worker_initial_upstreams_reload_test.go remove t.Parallel * internal/cmd/commands/server/worker_tags_reload_test.go wait by polling worker instead of sleep * internal/daemon/worker/routing_info.go make deep copy in LastRoutingInfoSuccess to avoid race condition * internal/tests/cluster/parallel/orphaned_connections_test.go raise grace period time to allow test to wait for longer * improve logging in sequential tests * move ports around and use t.Cleanup to send shutdown signal to test server * fix one typo * do final assert in t.Cleanup instead of defer * undo t.Cleanup change * add another signal to force shutdown running servers * add exit early and increase server start timeout * tighten workerRPC settings on session tests * tighten more workerRPC timing * make gen * add comment explaining deep copying lastRoutingInfoSuccess
This commit is contained in:
1 parent
0a165c0921
commit
fe09f61a85
15 files changed
+130
-76
No files matched your search
@@ -88,7 +88,7 @@ func testWorkerSessionCleanupSingle(burdenCase timeoutBurdenType) func(t *testin
|
||||
PublicClusterAddr: pl.Addr().String(),
|
||||
WorkerRPCGracePeriod: controllerGracePeriod(burdenCase),
|
||||
// Run the scheduler more often to speed up cleanup of orphaned connections
|
||||
SchedulerRunJobInterval: time.Second,
|
||||
SchedulerRunJobInterval: 500 * time.Millisecond,
|
||||
})
|
||||
|
||||
helper.ExpectWorkers(t, c1)
|
||||
@@ -283,7 +283,7 @@ func testWorkerSessionCleanupMulti(burdenCase timeoutBurdenType) func(t *testing
|
||||
InitialUpstreams: []string{p1.ListenerAddr(), p2.ListenerAddr()},
|
||||
Logger: logger.Named("w1"),
|
||||
SuccessfulControllerRPCGracePeriodDuration: helper.DefaultControllerRPCGracePeriod,
|
||||
WorkerRPCInterval: time.Second,
|
||||
WorkerRPCInterval: 500 * time.Millisecond,
|
||||
})
|
||||
|
||||
wg.Add(2)
|
||||
|
||||
@@ -46,10 +46,11 @@ func TestWorkerBytesUpDown(t *testing.T) {
|
||||
}
|
||||
|
||||
c1 := controller.NewTestController(t, &controller.TestControllerOpts{
|
||||
Config: conf,
|
||||
InitialResourcesSuffix: "1234567890",
|
||||
Logger: logger.Named("c1"),
|
||||
WorkerRPCGracePeriod: helper.DefaultControllerRPCGracePeriod,
|
||||
Config: conf,
|
||||
InitialResourcesSuffix: "1234567890",
|
||||
Logger: logger.Named("c1"),
|
||||
WorkerRPCGracePeriod: helper.DefaultControllerRPCGracePeriod,
|
||||
SchedulerRunJobInterval: 500 * time.Millisecond,
|
||||
})
|
||||
|
||||
helper.ExpectWorkers(t, c1)
|
||||
@@ -71,7 +72,7 @@ func TestWorkerBytesUpDown(t *testing.T) {
|
||||
Logger: logger.Named("w1"),
|
||||
SuccessfulControllerRPCGracePeriodDuration: helper.DefaultControllerRPCGracePeriod,
|
||||
EnableIPv6: true,
|
||||
WorkerRPCInterval: time.Second,
|
||||
WorkerRPCInterval: 500 * time.Millisecond,
|
||||
})
|
||||
|
||||
helper.ExpectWorkers(t, c1, w1)
|
||||
|
||||
@@ -47,10 +47,11 @@ func TestWorkerSessionProxyMultipleConnections(t *testing.T) {
|
||||
}
|
||||
|
||||
c1 := controller.NewTestController(t, &controller.TestControllerOpts{
|
||||
Config: conf,
|
||||
InitialResourcesSuffix: "1234567890",
|
||||
Logger: logger.Named("c1"),
|
||||
WorkerRPCGracePeriod: helper.DefaultControllerRPCGracePeriod,
|
||||
Config: conf,
|
||||
InitialResourcesSuffix: "1234567890",
|
||||
Logger: logger.Named("c1"),
|
||||
WorkerRPCGracePeriod: helper.DefaultControllerRPCGracePeriod,
|
||||
SchedulerRunJobInterval: 500 * time.Millisecond,
|
||||
})
|
||||
|
||||
helper.ExpectWorkers(t, c1)
|
||||
@@ -72,7 +73,7 @@ func TestWorkerSessionProxyMultipleConnections(t *testing.T) {
|
||||
Logger: logger.Named("w1"),
|
||||
SuccessfulControllerRPCGracePeriodDuration: helper.DefaultControllerRPCGracePeriod,
|
||||
EnableIPv6: true,
|
||||
WorkerRPCInterval: time.Second,
|
||||
WorkerRPCInterval: 500 * time.Millisecond,
|
||||
})
|
||||
|
||||
helper.ExpectWorkers(t, c1, w1)
|
||||
|
||||
@@ -79,7 +79,7 @@ func TestWorkerTagging(t *testing.T) {
|
||||
WorkerAuthKms: c1.Config().WorkerAuthKms,
|
||||
InitialUpstreams: c1.ClusterAddrs(),
|
||||
Logger: logger.Named("w2"),
|
||||
WorkerRPCInterval: time.Second,
|
||||
WorkerRPCInterval: 500 * time.Millisecond,
|
||||
})
|
||||
w2Addr := w2.ProxyAddrs()[0]
|
||||
|
||||
@@ -96,7 +96,7 @@ func TestWorkerTagging(t *testing.T) {
|
||||
WorkerAuthKms: c1.Config().WorkerAuthKms,
|
||||
InitialUpstreams: c1.ClusterAddrs(),
|
||||
Logger: logger.Named("w3"),
|
||||
WorkerRPCInterval: time.Second,
|
||||
WorkerRPCInterval: 500 * time.Millisecond,
|
||||
})
|
||||
w3Addr := w3.ProxyAddrs()[0]
|
||||
|
||||
|
||||
Reference in new issue
Block a user