Commit 64dca84
* Parallelize acceptance and integration tests (#1407)
## Summary
- Parallelize acceptance and integration tests, reducing CI wall time from ~90+ minutes to ~22 minutes
- Add test infrastructure for parallel execution: file-based locking, per-test namespaces, shared operator install, image import caching
- Fix flaky tests exposed by parallel execution
- Add debugging tooling: diagnostics on failure, feature-name namespaces, timing markers
- Speed up CI builds by only compiling for the host architecture and parallelizing Docker image pulls
## Details
### Acceptance test parallelization
Refactored the harpoon test framework to run BDD features in parallel. Features are partitioned by a `@serial` tag — features without it run concurrently via `t.Run` + `t.Parallel()`, while `@serial` features (decommissioning, helm-chart) run sequentially afterward since they perform k3d node operations.
- Moved the Redpanda operator from per-feature helm install to a single shared instance installed during `BeforeSuite`
- Features that need their own operator (upgrade tests) run in isolated vclusters (`@vcluster` tag)
- Setup and teardown are separated so the cluster isn't torn down between parallel and serial phases
### Integration test parallelization
- Refactored `RedpandaControllerSuite` from a testify suite with shared mutable state to parallel subtests with per-test namespaces
- Added `WatchAllNamespaces` option to `testenv.Env` so a single controller manager serves all test namespaces
- Parallelized `charts/redpanda` integration test subtests
- Parallelized `TestLicense` subtests across 4 image variants
- Removed `-p=1` gate on integration tests (now uses Go's default parallelism)
### CI build speedups
- Only compile `linux/amd64` binaries in CI (was building all 4 os/arch combos)
- Parallelize Docker image pre-pulls (~25 images pulled concurrently instead of sequentially)
- Pre-pull k3d infrastructure images (`rancher/k3s`, `k3d-tools`, `k3d-proxy`)
- Batch `k3d image import` calls (one command with all images instead of N separate calls)
- Cache imported images with marker files to avoid redundant imports across parallel test packages
### Cross-process coordination
- Added file-based locking (`flock`) around k3d cluster creation and image imports to prevent conflicts when multiple test packages run simultaneously
- Made CRD installation idempotent (tolerates "already exists" errors)
- Made cert-manager installation idempotent in `helmtest.Setup`
- Added cert-manager webhook readiness wait after k3s manifest installation
### Flaky test fixes
- Fixed `require.FailNow` inside `assert.Eventually` goroutine causing panics in `rpk.go`
- Added namespace scoping to Redpanda list queries to avoid cross-feature interference
- Added `waitForStatefulSetReady` after cluster availability checks (looks up StatefulSet by label, not name)
- Bumped k3d cluster creation timeout from 3 to 5 minutes
- Bumped vcluster creation timeout from 3 to 5 minutes
- Bumped PVC unbinder test timeouts
- Added retry for schema registry readiness in `FactoryOperatorV1`
- Overrode upgrade test operator images to use Docker Hub (pre-loaded into k3d) instead of `docker.redpanda.com`
- Added `--rerun-fails` to gotestsum for automatic retry of flaky tests
- Disabled k3s servicelb (unused in tests)
### Debugging improvements
- Feature namespaces now include the feature name (e.g. `test-basic-cluster-tests-abc123`)
- Added `=== FEATURE START/END/FAILED ===` log markers with timing
- Added `DumpDiagnostics` on feature failure: pod statuses, events, resource descriptions, pod logs
- Diagnostics written to `ACCEPTANCE_ARTIFACTS_DIR` when set (uploaded as CI artifacts)
- Added `dumpDiagnostics` to `testenv.Env` for integration test failures
- Added `DumpContainerLogsOnFailure` helper for testcontainer-based tests
- Added vcluster creation failure diagnostics (pod state + events from host namespace)
- Added `[TestName]` prefix to `waitFor` log messages for traceability in parallel output
- CI test output uses `testname` format (per-test lines with timing, verbose on failure)
### Pre-loaded images
Ensured all Docker images used by tests are pre-pulled and imported into k3d clusters to avoid in-test pulls:
- Added operator images for upgrade tests (`v25.1.3`, `v25.2.2`, `v25.3.1`)
- Added Redpanda images for license tests (`v24.2.9`, `v24.3.1-rc4`)
- Added `redpanda-nightly`, `redpanda-operator-nightly` for topic controller and factory tests
(cherry picked from commit ca83446)
# Conflicts:
# acceptance/steps/defaults.go
# acceptance/steps/multicluster.go
# charts/redpanda/testdata/template-cases.golden.txtar
# ci/scripts/run-in-nix-docker.sh
# harpoon/suite.go
# operator/internal/controller/redpanda/redpanda_controller_test.go
# pkg/vcluster/vcluster.go
* Fix up merge conflicts and remove non-backported multicluster acceptance test
* fix bad merge
* fix testing t usage
* fix test expectation
* try to fix up backport some more
* update to 26.1.2 for test runs
* regen golden files
* dump logs on cluster config failure
* fix configuration test by backport
* license constant swap
---------
Co-authored-by: Andrew Stucki <andrew.stucki@redpanda.com>
1 parent 1d57ad1 commit 64dca84
File tree
44 files changed
+1838
-720
lines changed- .buildkite
- acceptance
- features
- steps
- charts/redpanda
- ci/scripts
- gen/pipeline
- harpoon
- internal
- testing
- tracking
- providers
- operator
- internal
- controller
- pvcunbinder
- redpanda
- lifecycle/testdata
- probes
- testenv
- pkg
- client
- utils/testutils
- pkg
- helm/helmtest
- k3d
- vcluster
- taskfiles
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
44 files changed
+1838
-720
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
121 | 125 | | |
122 | 126 | | |
123 | 127 | | |
| 128 | + | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
| |||
169 | 175 | | |
170 | 176 | | |
171 | 177 | | |
| 178 | + | |
| 179 | + | |
172 | 180 | | |
173 | 181 | | |
174 | 182 | | |
| |||
218 | 226 | | |
219 | 227 | | |
220 | 228 | | |
| 229 | + | |
| 230 | + | |
221 | 231 | | |
222 | 232 | | |
223 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
267 | 270 | | |
268 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
269 | 277 | | |
270 | 278 | | |
271 | 279 | | |
| |||
284 | 292 | | |
285 | 293 | | |
286 | 294 | | |
287 | | - | |
| 295 | + | |
288 | 296 | | |
289 | 297 | | |
290 | 298 | | |
| |||
330 | 338 | | |
331 | 339 | | |
332 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
333 | 345 | | |
334 | 346 | | |
335 | 347 | | |
| |||
339 | 351 | | |
340 | 352 | | |
341 | 353 | | |
| 354 | + | |
| 355 | + | |
342 | 356 | | |
343 | 357 | | |
344 | 358 | | |
345 | 359 | | |
346 | 360 | | |
347 | 361 | | |
| 362 | + | |
348 | 363 | | |
| 364 | + | |
349 | 365 | | |
| 366 | + | |
350 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
351 | 375 | | |
| 376 | + | |
352 | 377 | | |
353 | 378 | | |
354 | | - | |
355 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
356 | 386 | | |
357 | 387 | | |
358 | 388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| |||
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | | - | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
0 commit comments