Skip to content

Fix etcd test flakiness with shared container - #25

Merged
bpalermo merged 1 commit into
mainfrom
fix/etcd-test-shared-container
Mar 7, 2026
Merged

bpalermo merged 1 commit into
mainfrom
fix/etcd-test-shared-container

Conversation

@bpalermo

@bpalermo bpalermo commented Mar 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace per-test container startup (13 containers) with a single shared container via TestMain
  • Use per-test key prefixes (t.Name()) for data isolation between tests
  • Add health check in TestMain to verify etcd is ready before tests run
  • Use t.Cleanup for consistent resource cleanup

Results

Metric Before After
Containers per run 13 1
Runtime ~39s ~6s
Flakiness Intermittent timeouts 3/3 passes (avg 9.7s, dev 0.3s)

Root cause: Each test spawned its own etcd container. When run in parallel with other targets via bazel test //..., Docker resource contention caused container startup delays exceeding the 5s dial timeout.

Test plan

  • All tests pass (bazel test //...)
  • 3/3 consecutive runs pass (--runs_per_test=3)

🤖 Generated with Claude Code

Replace per-test container startup (13 containers) with a single shared
container via TestMain, using per-test key prefixes for isolation.
Add a health check in TestMain to ensure etcd is ready before tests run.

Reduces test runtime from ~39s to ~6s and eliminates timeout flakiness
caused by Docker resource contention during parallel test execution.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@bpalermo
bpalermo merged commit 82b8c62 into main Mar 7, 2026
3 checks passed
@bpalermo
bpalermo deleted the fix/etcd-test-shared-container branch March 7, 2026 20:24
bpalermo added a commit that referenced this pull request Sep 13, 2026
…768)

Clears the two open Dependabot alerts on the site's Python closure:

  - #24 GHSA-9xwg-3r6f-jcx2 (medium): path traversal in the b64 extension
    lets an <img src> read files outside base_path. Affects <= 10.21.3,
    fixed in 11.0.0.
  - #25 GHSA-gm37-52c6-37mw (high): exponential-backtracking ReDoS in the
    caret, tilde, betterem, and magiclink inline processors. Affects
    <= 11.0.0, fixed in 11.0.1.

  pymdown-extensions 10.21.3 -> 11.0.2

Nothing else in the lock moved. pymdown-extensions is transitive via
mkdocs-material, so requirements.in now carries an explicit
`pymdown-extensions>=11.0.1` floor with the advisory ids. uv already
resolves 11.0.2 from mkdocs-material 9.7.7 alone (the pin in the lock was
simply stale), but the floor is what keeps a future resolution — and the
alert — from sliding back. Lock regenerated with the exact command in the
requirements.in header; MODULE.bazel.lock picks up the new pip hub wheels.

Verified:
  - bazel test //website:all -> //website:site_test PASSED (the strict
    mkdocs build, --strict, plus the third-party audit)
  - bazel build //website:site; untarred (149 files) and grepped for
    unpkg.com, cdn.jsdelivr.net, fonts.googleapis.com, fonts.gstatic.com,
    cdnjs.cloudflare.com, api.github.com -> 0 hits
  - make format-check -> clean
  - bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation
    //... -> clean


Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant