Skip to content

CI: harden test execution - #1114

Merged
zardus merged 1 commit into
masterfrom
codex/ci-harden-dojo-tests
Jul 26, 2026
Merged

CI: harden test execution#1114
zardus merged 1 commit into
masterfrom
codex/ci-harden-dojo-tests

Conversation

@zardus

@zardus zardus commented Jul 26, 2026

Copy link
Copy Markdown
Member

Summary

Scope

This PR is strictly CI/test-only. It changes exactly:

  • .github/workflows/ci.yml
  • test/test_background_stats.py
  • test/utils.py

It contains no runtime, production, image-build, Compose, or dependency changes.

Validation

  • Python syntax check
  • workflow YAML parse
  • whitespace check
  • full single-node and multi-node suites in GitHub Actions

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 master before deleting this branch.

@zardus
zardus force-pushed the codex/ci-harden-dojo-tests branch from 40b760d to e26ead5 Compare July 26, 2026 16:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread test/test_background_stats.py Outdated
redis_delete(cache_key, f"{cache_key}:updated")
restart_time = time.time()
restart = dojo_run(
"docker", "restart", "--time", "1", "stats-worker", check=False

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@zardus
zardus force-pushed the codex/ci-harden-dojo-tests branch from e26ead5 to cddd17c Compare July 26, 2026 16:22
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zardus
zardus force-pushed the codex/ci-harden-dojo-tests branch from cddd17c to c09419a Compare July 26, 2026 18:06
@zardus zardus changed the title CI: harden startup and test execution CI: harden test execution Jul 26, 2026
@zardus
zardus merged commit 45748bd into master Jul 26, 2026
4 checks passed
@zardus
zardus deleted the codex/ci-harden-dojo-tests branch July 26, 2026 22:31
zardus added a commit that referenced this pull request Jul 27, 2026
## 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
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