Skip to content

feat: S13.21 re-enable @windows_wip store_capacity scenarios#284

Merged
DavidCozens merged 4 commits into
mainfrom
feat/s13-21-reenable-windows-wip-store-capacity
May 7, 2026
Merged

feat: S13.21 re-enable @windows_wip store_capacity scenarios#284
DavidCozens merged 4 commits into
mainfrom
feat/s13-21-reenable-windows-wip-store-capacity

Conversation

@DavidCozens

@DavidCozens DavidCozens commented May 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • S13.21 proper — drop the four @windows_wip tags + the long explanatory note from Bdd/features/store_capacity.feature. S12.14's eager-drain refactor is on main, so the architectural blocker is gone; the existing 10/8-message form works on both runners with no retune needed.
  • Local BDD plumbing fixes (no-ops on CI) — two chronic issues that blocked TCP-outage scenarios from running under the Windows-hosted Docker Desktop devcontainer:
    1. shutil.copyshutil.copyfile in syslog_ng_swap_config and the after_scenario hook. The bind-mounted syslog-ng.conf is owned by the host user, so copy()'s chmod step fails with EPERM and truncates the config; copyfile copies bytes only and leaves the host-set mode intact.
    2. syslog-ng compose entrypoint now keeps a 100ms-tick watchdog re-chmoding syslog-ng.ctl to 0777 for the lifetime of the container. RELOAD recreates the socket with default 0755, which the developer-uid behave container can't connect(2) to.
  • BDD timeout bumpwait_for_messages deadline 5s → 10s. Pre-emptive flake mitigation; the buffered example's launch + cert load + TLS handshake + Send + oracle write was tight on slow Windows runners (mTLS scenario in PR feat: S12.14 decouple buffer drain from sender state — fail-fast streams + eager Service drain #283 timed out once and passed on retry). 10s gives comfortable margin without changing test intent.

Test plan

  • All four store_capacity scenarios pass locally on Linux (gcc devcontainer + behave compose service).
  • Full BDD suite green locally — 21 features, 46 scenarios, 242 steps.
  • CI bdd-linux-syslog-ng passes.
  • CI bdd-windows-otel passes — the actual S13.21 verification, since the Windows runner was the previously-failing one.
  • CI's other gates (build/sanitize/coverage/tidy/cppcheck/format/iwyu) — none should be affected by feature-file-only / Bdd-only changes, but verifying.

Closes #278

Summary by CodeRabbit

  • Chores

    • Improved development container socket permission handling with continuous monitoring.
    • Enhanced test infrastructure reliability for configuration management.
  • Tests

    • Extended syslog message reception timeout from 5 to 10 seconds for improved test stability.
    • Removed Windows-specific test workarounds to streamline test suite.

DavidCozens and others added 3 commits May 7, 2026 10:53
The 5s budget for the buffered example to complete launch + cert load +
TLS handshake + Send + oracle write was flake-prone on the Windows OTel
runner under load (mTLS scenario in PR #283 timed out once and passed
on retry). 10s gives comfortable margin without changing test intent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two chronic local-only issues blocked TCP-outage scenarios from running
under the Windows-hosted Docker Desktop devcontainer; CI (which runs in
its own Linux VM with matching UID/GID) was unaffected. Both fixes are
no-ops for CI.

1. shutil.copy → shutil.copyfile in syslog_ng_swap_config (steps) and
   after_scenario (environment). The destination syslog-ng.conf is
   bind-mounted from the host and not owned by the container's
   `developer` user; copy()'s chmod step then fails with EPERM and
   leaves the config truncated. copyfile copies bytes only, so the
   file's existing mode (set by the host) is left intact.

2. syslog-ng compose entrypoint now keeps a watchdog re-chmodding
   /var/lib/syslog-ng/syslog-ng.ctl to 0777. syslog-ng RELOAD recreates
   the socket with default 0755 perms; the behave container connects as
   `developer` and needs world-writable to call connect(2). Single
   100ms-tick background loop, exits with the syslog-ng pid.

Closes the open follow-up tracked in MEMORY:project_syslog_ng_conf_corruption.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
S12.14's eager-drain refactor decoupled buffer drain from sender state
on both runners; the four store_capacity discard scenarios that were
tagged @windows_wip pending that fix now run reliably end-to-end.

Drop the four @windows_wip tags and the long explanatory note; the
existing 10/8-message form gives sufficient margin for the discard
policy to engage with both runners. Locally verified all 4 scenarios
pass on Linux (and the full BDD suite — 21 features, 46 scenarios,
242 steps — remains green).

Closes #278

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Rate limit exceeded

@DavidCozens has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 51 minutes and 16 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 484c4a32-5eb7-4672-8026-d61ca9f1a30b

📥 Commits

Reviewing files that changed from the base of the PR and between d019cc1 and 129a7ff.

📒 Files selected for processing (2)
  • Bdd/features/environment.py
  • Bdd/features/steps/syslog_steps.py
📝 Walkthrough

Walkthrough

This PR fixes BDD infrastructure robustness by addressing socket permission handling in Docker Compose (switching to a continuous watchdog loop), updates file copy operations to avoid bind-mount permission errors, extends message receive timeout, and re-enables four store capacity test scenarios by removing @windows_wip tags after upstream architectural fixes land.

Changes

BDD Infrastructure Robustness & Store Capacity Re-enablement

Layer / File(s) Summary
Docker syslog-ng Watchdog Loop
.devcontainer/docker-compose.yml
Startup script replaces one-time socket chmod with a background watchdog that continuously reapplies chmod 0777 to /var/lib/syslog-ng/syslog-ng.ctl while syslog-ng is running, ensuring permissions persist across config reloads.
BDD Config Restore & Swap Operations
Bdd/features/environment.py, Bdd/features/steps/syslog_steps.py
Config restoration and swapping operations switch from shutil.copy() to shutil.copyfile(), avoiding permission metadata preservation on developer bind-mounted files.
Message Receive Timeout Extension
Bdd/features/steps/syslog_steps.py
wait_for_messages timeout increases from 5 to 10 seconds to allow more time for the syslog oracle to count expected logical records.
Store Capacity Scenario Re-enablement
Bdd/features/store_capacity.feature
Removes @windows_wip tags and explanatory note from four discard-policy scenarios (discard-oldest, discard-newest, halt-exits-process, halt-prevents-further-service), re-enabling them after upstream S12.14 architectural changes make the store the overflow point instead of the buffer.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A watchdog loops with faithful grace,
While bind-mounts now find safer place—
With content-only copies clean,
The socket perms are now serene,
And Windows tests rejoin the race! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: re-enabling the @windows_wip store_capacity scenarios following completion of S13.21.
Description check ✅ Passed The description comprehensively covers purpose (closes #278), detailed change rationale, technical fixes with explanations, timeout adjustments, and a clear test plan with both completed and pending CI validations.
Linked Issues check ✅ Passed All objectives from issue #278 are met: four @windows_wip tags removed, explanatory note deleted, store overflow scenarios validated with existing 10/8-message form, and feature-file-only changes implemented with supporting plumbing fixes.
Out of Scope Changes check ✅ Passed All changes directly support the S13.21 objective: feature-file cleanup, localized BDD plumbing fixes for Windows devcontainer issues, and timeout adjustment for flake mitigation. No extraneous modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/s13-21-reenable-windows-wip-store-capacity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Bdd/features/environment.py`:
- Around line 136-140: The shutil.copyfile call that restores SYSLOG_NG_CONF
from SYSLOG_NG_FULL_CONF is executed outside the guarded teardown block and can
raise exceptions that bypass the subsequent try/except cleanup; move the
shutil.copyfile(...) into the same try block that handles reload/wait so that
any copy failure is caught and handled alongside the reload logic when
context.syslog_ng_config_changed is true, keeping the condition check on
context.syslog_ng_config_changed and leaving the reload/wait and exception
handling intact.

In `@Bdd/features/steps/syslog_steps.py`:
- Around line 470-480: The syslog_ng_swap_config function can leave the system
in a bad state if shutil.copyfile succeeds but syslog_ng_reload() fails; make
the swap transactional by first creating a safe backup of SYSLOG_NG_CONF (e.g.,
temp file), then copy the new config, attempt syslog_ng_reload() inside a try
block, and if reload raises/returns failure restore the backup (and optionally
retry reload) so the original config is reinstated; ensure the backup is removed
on success and that any exceptions still allow teardown to see the context flag
by re-raising after cleanup. Use the existing function names
syslog_ng_swap_config, syslog_ng_reload and the SYSLOG_NG_CONF constant to
locate where to add the try/except/finally backup-and-restore logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 81ecf186-e964-4c59-8bf2-6248484ef8e7

📥 Commits

Reviewing files that changed from the base of the PR and between 89fd6ce and d019cc1.

📒 Files selected for processing (4)
  • .devcontainer/docker-compose.yml
  • Bdd/features/environment.py
  • Bdd/features/steps/syslog_steps.py
  • Bdd/features/store_capacity.feature
💤 Files with no reviewable changes (1)
  • Bdd/features/store_capacity.feature

Comment thread Bdd/features/environment.py
Comment thread Bdd/features/steps/syslog_steps.py
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1090 passed, 🙈 3 skipped)
   🚦   build-linux-clang: 100% successful (✔️ 1037 passed, 🙈 3 skipped)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1037 passed, 🙈 3 skipped)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 100% successful (✔️ 46 passed)
   🚦   bdd-windows-otel: 96% successful (✔️ 44 passed, 🙈 2 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 948 passed, 🙈 1 skipped)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

- environment.py after_scenario: move shutil.copyfile inside the existing
  try/except so a copyfile failure is logged via the warning path rather
  than bypassing the rest of teardown.
- syslog_steps.py step_oracle_stops_tcp: set
  context.syslog_ng_config_changed = True *before* syslog_ng_swap_config()
  rather than after. Any failure inside swap (or the subsequent wait /
  probe teardown / sleep) still triggers the after_scenario restore path —
  otherwise a half-applied swap would leave the on-disk config in
  UDP-only mode and contaminate the next scenario.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1090 passed, 🙈 3 skipped)
   🚦   build-linux-clang: 100% successful (✔️ 1037 passed, 🙈 3 skipped)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1037 passed, 🙈 3 skipped)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 100% successful (✔️ 46 passed)
   🚦   bdd-windows-otel: 96% successful (✔️ 44 passed, 🙈 2 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 948 passed, 🙈 1 skipped)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@DavidCozens DavidCozens merged commit 7a2ccfa into main May 7, 2026
18 checks passed
@DavidCozens DavidCozens deleted the feat/s13-21-reenable-windows-wip-store-capacity branch May 7, 2026 10:14
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.

S13.21: Re-enable @windows_wip store_capacity scenarios with re-targeted assertions

1 participant