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:
Sorawis Nilparuk (Bo) authored and GitHub committed 2026-01-05 10:40:28 -08:00
1 parent 0a165c0921
commit fe09f61a85
15 files changed
+130 -76

No files matched your search

@@ -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)