flaky test: mosaic "whole mutator-class lease gate > observer revocation and monotonic TTL expiry deny the next mutator" (timing flake) blocks #856/#858 terminal completion #860

Closed
opened 2026-07-20 10:05:15 +00:00 by jason.woltje · 0 comments
Owner

Summary

The test case whole mutator-class lease gate > observer revocation and monotonic TTL expiry deny the next mutator in package @mosaicstack/mosaic is a timing/real-time flake. It passes deterministically in pull_request CI but flaked in the push (descendant-on-main) pipeline, producing a RED descendant CI that leaves two already-merged issues (#856, #858) terminal-incomplete under the completion contract (a merged PR requires a terminal-green descendant CI).

Evidence (classified — NOT a content regression)

  • Failure: Woodpecker pipeline #1945 (event push, commit acd7d380 = the #858 squash-merge), test step 49706 = failure, exit 1.
  • Assertion observed: expected { ok: false } to match object { ok: true, decision: 'allow' } inside the multi-step case (an early setup expectation was denied under a lost timing race).
  • Same tree passed twice as non-push: PR CI #1943 (pull_request @ 1e6937c4, the identical #858 content) = success; #857 push CI #1944 (@ 3b70c66) = success. Only the concurrent push run flaked.
  • Root-cause signature: the case is real-time TTL / monotonic-expiry sensitive and ran alongside the full build-gateway / build-appservice / build-web matrix on the push pipeline (resource contention). The log also carried unrelated external noise (OpenRouter model-discovery HTTP 500 -> modelRegistry.getAvailable is not a function, peer-certificate parse warning).

Scope

De-flake ONLY the test's determinism for this monotonic-TTL lease-gate case (e.g. injectable/fake clock, case isolation, eliminate real-time sleeps / wall-clock waits). This is a CI-hygiene / test-determinism fix.

Integrity constraints (binding)

  • Red-first repro of the flake before any fix.
  • PRESERVE the monotonic-expiry security assertion UN-WEAKENED — the deny-the-next-mutator semantics must remain intact. De-flaking is test-determinism ONLY; do NOT loosen, remove, repoint, or skip the assertion to make it stable.
  • Independent CODE review, author != builder.
  • Fresh exact-head CI terminal-green, reviewed squash merge under the standard 6-check named-executor clearance (fails-closed).
  • A terminal-green containing descendant CI then closes out #856 + #858 completion.
  • HARD GUARD: if the true root cause requires CHANGING the lease-gate SECURITY SEMANTICS (not just test determinism), STOP and escalate — do NOT weaken a security assertion to de-flake.

Completion linkage

This issue is the completion-blocker for the already-merged #856 and #858 (both on main; only their terminal-green descendant CI is outstanding). Integrity pattern follows the prior flake-fix precedent #849.

## Summary The test case `whole mutator-class lease gate > observer revocation and monotonic TTL expiry deny the next mutator` in package `@mosaicstack/mosaic` is a **timing/real-time flake**. It passes deterministically in `pull_request` CI but flaked in the `push` (descendant-on-main) pipeline, producing a RED descendant CI that leaves two already-merged issues (#856, #858) **terminal-incomplete** under the completion contract (a merged PR requires a terminal-green descendant CI). ## Evidence (classified — NOT a content regression) - **Failure:** Woodpecker pipeline **#1945** (event `push`, commit `acd7d380` = the #858 squash-merge), test step 49706 = failure, exit 1. - **Assertion observed:** `expected { ok: false } to match object { ok: true, decision: 'allow' }` inside the multi-step case (an early setup expectation was denied under a lost timing race). - **Same tree passed twice as non-push:** PR CI **#1943** (`pull_request` @ `1e6937c4`, the identical #858 content) = success; #857 push CI **#1944** (@ `3b70c66`) = success. Only the concurrent push run flaked. - **Root-cause signature:** the case is real-time TTL / monotonic-expiry sensitive and ran alongside the full `build-gateway` / `build-appservice` / `build-web` matrix on the push pipeline (resource contention). The log also carried unrelated external noise (OpenRouter model-discovery HTTP 500 -> `modelRegistry.getAvailable is not a function`, peer-certificate parse warning). ## Scope De-flake ONLY the test's determinism for this monotonic-TTL lease-gate case (e.g. injectable/fake clock, case isolation, eliminate real-time sleeps / wall-clock waits). This is a CI-hygiene / test-determinism fix. ## Integrity constraints (binding) - **Red-first repro** of the flake before any fix. - **PRESERVE the monotonic-expiry security assertion UN-WEAKENED** — the `deny-the-next-mutator` semantics must remain intact. De-flaking is test-determinism ONLY; do NOT loosen, remove, repoint, or skip the assertion to make it stable. - **Independent CODE review**, author != builder. - **Fresh exact-head CI terminal-green**, reviewed squash merge under the standard 6-check named-executor clearance (fails-closed). - A **terminal-green containing descendant CI** then closes out #856 + #858 completion. - **HARD GUARD:** if the true root cause requires CHANGING the lease-gate SECURITY SEMANTICS (not just test determinism), STOP and escalate — do NOT weaken a security assertion to de-flake. ## Completion linkage This issue is the completion-blocker for the already-merged **#856** and **#858** (both on `main`; only their terminal-green descendant CI is outstanding). Integrity pattern follows the prior flake-fix precedent #849.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#860