CI: harden test execution - #1114
Conversation
40b760d to
e26ead5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40b760d85f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| redis_delete(cache_key, f"{cache_key}:updated") | ||
| restart_time = time.time() | ||
| restart = dojo_run( | ||
| "docker", "restart", "--time", "1", "stats-worker", check=False |
There was a problem hiding this comment.
Drain pending stats events before restarting the worker
When an earlier stats test leaves an event claimed or in flight, this one-second restart can strand it permanently: the SIGTERM handler in dojo_plugin/worker/__main__.py only sets a flag that the consumption loop never reads, while consume_stat_events reads only new (">") messages and never reclaims pending ones. The replacement worker therefore skips any entries held by the killed process, causing later integration tests to observe missing cache updates or a permanently nonempty stream; drain the stream before restarting or add graceful shutdown/pending-message recovery.
Useful? React with 👍 / 👎.
e26ead5 to
cddd17c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
cddd17c to
c09419a
Compare
## Summary - select only patch files from the bundled CTFd patch directory - apply them in deterministic lexical order - make patch rejection fail the image build immediately ## Scope This is independent image-build hardening. It is intentionally separate from CI PR #1114 and is not a prerequisite for #1111 or #1112; the existing runner applies both feature patches successfully. ## Validation - applied the #1111 patch set, #1112 patch set, and combined patch set to pristine CTFd 3.6.0 with both runners - confirmed identical successful patched trees - confirmed the old runner masks a forced patch failure while this runner exits nonzero - Dockerfile whitespace checks - full single-node and multi-node suites in GitHub Actions
Summary
Scope
This PR is strictly CI/test-only. It changes exactly:
.github/workflows/ci.ymltest/test_background_stats.pytest/utils.pyIt contains no runtime, production, image-build, Compose, or dependency changes.
Validation
Stack
The seven feature PRs (#1105, #1106, #1108, #1110, #1111, #1112, and #1113) each contain one feature-only commit directly above this branch.
Shared schema-startup hardening is isolated in #1115. Image-build patch-runner hardening is isolated in #1116. Neither is a prerequisite for any feature PR.
Merge this PR first, then retarget the nine sibling PRs to
masterbefore deleting this branch.