Repository navigation
test(events): count the throttle lock warning; harden the Windows fingerprint fallback - #4726
Merged
Merged
Conversation
…gerprint fallback The D1 "warn once" spec asserted only that the flag was set, so a regression that kept the flag but dropped the early return (back to a WriteLog per failure) would still pass. Route the warning through an overridable $errorEmailThrottleLogWarning() seam and have the spec mock it and count the calls: three failures must produce exactly one warning. Verified by mutation: removing the early return yields "Expected [1] Actual [3]" and the spec fails; restoring it passes. Also address the Windows note: when GetFileFromPath returns empty for a normalized path, fall back to the last path segment (ListLast on "/") and then "no-frame", never the full deployment path, so the same failure cannot split across installs. No throttle behaviour changes: fail-open, one warning per application, caps accepting 0 as unlimited, and the window rejecting 0 are unchanged. Signed-off-by: Peter Amiri <peter@alurium.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the merged #4694 throttling work (
c6fb3afe8) for r2's test-quality note: the "warn once" spec proved less than its name claimed. It asserted the flag was set but never counted warnings, so a regression that keeps the flag and removes the early return (oneWriteLogper failure) would still pass — reintroducing the log flood D1 exists to prevent.Change
$errorEmailThrottleLogWarning(), which does the sameWriteLog(file="wheels", type="warning", …)inside the same try/catch.prepareMock+$()) and calls$warnErrorEmailThrottleLockFailure()three times: it now asserts$count("$errorEmailThrottleLogWarning")is 1, not just that the flag is set.GetFileFromPathreturns empty for a normalized path, fall back to the last path segment (ListLast(normalized, "/")) and then"no-frame"— never the full deployment path, which could split the same failure across installs. Documented in the code comment.No throttle behaviour changes: fail-open, one warning per application, caps accepting
0as unlimited, and the window rejecting0are byte-identical.Mutation proof (required)
Temporarily deleted the early-return block from
$warnErrorEmailThrottleLockFailure()(flag still set, one warning per call), ran the focused spec:Restored the early return: 14 passed.
Verification
ErrorEmailThrottleSpec: 14 passed (Lucee 7).tools/test-matrix.sh adobe2023 sqlite: pass (after the one-time cold engine install) — MockBox seam works on Adobe.CI on
ad9f64b45CLEAN (24 checks, 0 failing). One transient first-run failure on
Deploy CLI tests + verb smoke/CLI suitewas the known Maven Central HTTP 429 on the sqlite-jdbc download (before any Wheels code ran);gh run rerun --failedpassed and the final state is green. All engine legs (Lucee, Adobe 2023/2025, BoxLang, RustCFML) green.