• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

oracle / oci-cloud-controller-manager / 23685486535
35%
master: 36%

Build:
Build:
LAST BUILD BRANCH: pr/flex-cidr-allocator
DEFAULT BRANCH: master
Ran 31 Mar 2026 07:02AM UTC
Jobs 1
Files 64
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Mar 2026 12:43PM UTC coverage: 35.464%. Remained the same
23685486535

Pull #528

github

HadrienPatte
External-ccm: Use `testing/synctest` to eliminate waits in tests

`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>
Pull Request #528: Use `testing/synctest` to eliminate waits in tests

0 of 5 new or added lines in 1 file covered. (0.0%)

5 existing lines in 1 file now uncovered.

6386 of 18007 relevant lines covered (35.46%)

6.65 hits per line

Uncovered Changes

Lines Coverage ∆ File
5
0.0
0.0% pkg/util/mock_oci_clients.go

Coverage Regressions

Lines Coverage ∆ File
5
0.0
0.0% pkg/util/mock_oci_clients.go
Jobs
ID Job ID Ran Files Coverage
1 23685486535.1 31 Mar 2026 07:02AM UTC 64
35.46
GitHub Action Run
Source Files on build 23685486535
  • Tree
  • List 64
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #528
  • PR Base - master (#23437046615)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc