Update Testcontainers infrastructure and remove container pre-warming - #9066
Update Testcontainers infrastructure and remove container pre-warming#9066bouwkast wants to merge 3 commits into
Conversation
|
No sorry not ready trying to split up my PR into a stack |
BenchmarksBenchmark execution time: 2026-08-17 19:13:17 Comparing candidate commit 40d42ba in PR branch Found 1 performance improvements and 2 performance regressions! Performance is the same for 69 metrics, 0 unstable metrics, 70 known flaky benchmarks, 56 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9066) and master.
|
|||||||||||||||||||||||||||||||||||
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Baseline | ||||
| duration | 190.35 ± (190.91 - 191.69) ms | 215.02 ± (214.79 - 215.76) ms | +13.0% | ❌⬆️ |
| .NET Framework 4.8 - Bailout | ||||
| duration | 194.19 ± (194.09 - 194.56) ms | 220.22 ± (219.66 - 220.47) ms | +13.4% | ❌⬆️ |
| .NET Framework 4.8 - CallTarget+Inlining+NGEN | ||||
| duration | 1151.33 ± (1150.44 - 1155.97) ms | 1276.82 ± (1274.27 - 1281.29) ms | +10.9% | ❌⬆️ |
Summary of changes
This updates Testcontainers to V4 and changes how the shared test containers are started and managed throughout their lifecycle.
The end state will be that when an integration test(s) start up they will start their container via Testcontainer if it isn't already running (multiple tests can use the same container). When the tests are all done, the container will also stop.
This frees up resources that we otherwise would have tied up for the entirety of the entire test run for the TFM.
Reason for change
We suspect that having all of our docker containers running in CI agents is a potential factor in causing test flake.
The goal here is to change to only starting docker containers when we need them just before the tests and then end them when the tests finish. This should help reclaim resources instead of having 10 or so docker containers running at once.
Granted (with the complete stack of changes) this does appear to add a few minutes of overall time to the CI, but hoping that this reduces flake to offset that.
Implementation details
Test coverage
Relying on CI for these - note that in #8960 I re-ran the docker stages ~10 x and noticed no flake.
Other details
This is the first PR in a stack. Follow-up PRs will migrate individual test suites to Testcontainers
Original PR containing all: #8960