Use `testing/synctest` to eliminate waits in tests by HadrienPatte · Pull Request #528 · oracle/oci-cloud-controller-manager
`pkg/csi/driver` tests currently take more than 4 minutes to run and cause timeouts in CI (exit code 143, SIGTERM from runner). This is caused by 14 "timeout" sub-tests across `bv_controller_test.go` and `fss_controller_test.go` each blocking for a full testTimeout (15s) of real wall-clock time (~210s total). These tests verify that operations correctly propagate context cancellation when a volume or attachment gets stuck. The mocks simulate an infinite page stream using a non-blocking select with a default branch, causing the caller's pagination loop to spin-wait on the CPU until the context deadline elapses in real time. Since [go 1.25](https://go.dev/doc/go1.25#new-testingsynctest-package), go supports using fake time to reliabily test those scenarios without having to wait for the actual timeout when running the tests. See [Testing concurrent code with testing/synctest](https://go.dev/blog/synctest). This PR updates those tests to use `testing/synctest`: * Update go from 1.24 to 1.25 to have `testing/synctest` support. * Wrap each affected `t.Run` body in `synctest.Test()`, so `context.WithTimeout` and all mock calls run under a fake clock. * Change the five non-blocking `select { default: }` branches in `mock_oci_clients.go` to `select { case <-time.After(mockPollInterval): }`, making goroutines durably block so the fake clock can advance. * Move the shared `context.WithTimeout` in `fss_controller_test.go` inside each `t.Run` (it was incorrectly shared across sub-tests in a loop). Before: ``` ok github.com/oracle/oci-cloud-controller-manager/pkg/csi/driver 231.711s ``` After: ``` ok github.com/oracle/oci-cloud-controller-manager/pkg/csi/driver 1.933s ``` Result: `pkg/csi/driver` tests are 100x faster Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>