Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions project/TICKETS.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,6 @@ This file indexes governance tickets without taking ownership of
| **ticket-252** | [`README.md`](./ticket-252/README.md) | - | - | - | - | - |
| **ticket-253** | [`README.md`](./ticket-253/README.md) | - | - | - | - | - |
| **ticket-254** | [`README.md`](./ticket-254/README.md) | - | - | - | - | - |
| **ticket-256** | [`README.md`](./ticket-256/README.md) | - | - | - | - | - |
| **ticket-257** | [`README.md`](./ticket-257/README.md) | - | - | - | - | - |
<!-- AUTO:TICKET_INDEX:END -->
37 changes: 37 additions & 0 deletions project/ticket-257/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Ticket 257: Deterministic bulk deadline radar test

- **ID**: ticket-257
- **Owner**: agent:antigravity
- **Status**: IN_PROGRESS
- **Workflow state**: EDIT
- **Created**: 2026-10-28

## Goal and scope

SESSION_EXECUTION_AUTHORIZATION: the user asked to remove recurring load-sensitive
verification failures. `tests/test_ticket_radar.py::test_failure_bulk_deadline_preserves_remaining_tickets`
failed intermittently on `main` and on unrelated branches (ticket-256 PR 315: 1 pass in
4 runs; `main`: 2 of 3 passes at load average 50-70). It used a 0.35 s bulk deadline and a
0.2 s fake radar, so Python subprocess start-up time decided the outcome.

Test-only change; no production code is modified.

## Changes

- The fake radar answers its first call immediately and blocks on every later call.
- `BULK_SECONDS` and `ASSESSMENT_SECONDS` are set to 2.0 s, so the first call never
depends on start-up speed and the remaining calls are cut by the bulk deadline.
- Assertions keep the original intent: total radar time is bounded, at most two radar
calls happen, the first ticket is enriched, all other tickets keep their human text and
every ticket plus its operational event is preserved.

## Acceptance criteria

- [x] AC-01: The test passed 6 of 6 consecutive runs at load average above 15.
- [x] AC-02: The whole `tests/test_ticket_radar.py` file passes.
- [x] AC-03: `./project/governance-check.sh` passes.

## Tracking boundary

This directory contains the minimal reviewed intent. Optional participant prose
and raw command logs are not required delivery output.
24 changes: 24 additions & 0 deletions project/ticket-257/intent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"schema": "new-project.intent/v3",
"ticket": "ticket-257",
"summary": "Deterministic bulk deadline radar test",
"workstream": "application",
"classification": {
"kind": "BUG",
"priority": "P2",
"origin": "regression"
},
"allowedPaths": [
"project/ticket-257/**",
"TODO.md",
"project/TICKETS.md",
"tests/test_ticket_radar.py"
],
"forbiddenPaths": [
"project/ticket-*/user-*.md"
],
"stacks": [],
"dependsOn": [],
"conflictsWith": [],
"integrationTicket": null
}
21 changes: 17 additions & 4 deletions tests/test_ticket_radar.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,21 @@ def capture_pipe(command, **kwargs):


def test_failure_bulk_deadline_preserves_remaining_tickets(tmp_path, fake_radar, monkeypatch):
fake_radar("time.sleep(0.2)\n")
monkeypatch.setattr(radar, "BULK_SECONDS", 0.35)
# Deterministic under host load: the first radar call answers immediately and
# every later call blocks until the bulk deadline, so no outcome depends on
# how long a Python subprocess takes to start.
marker = tmp_path / "radar-called"
fake_radar(
prelude=f"""
marker = {str(marker)!r}
if os.path.exists(marker):
time.sleep(60)
open(marker, 'w').close()
"""
)
bulk_seconds = 2.0
monkeypatch.setattr(radar, "BULK_SECONDS", bulk_seconds)
monkeypatch.setattr(radar, "ASSESSMENT_SECONDS", bulk_seconds)
elapsed = []
original_bundle = radar._bundle

Expand All @@ -353,11 +366,11 @@ def measured_bundle(*args):
tickets = pf.create_tickets_bulk(
[{"name": f"Bulk {index}", "description": DESCRIPTION} for index in range(12)]
)
assert sum(elapsed) < 1.5
assert sum(elapsed) < bulk_seconds + 1.5
assert len(elapsed) <= 2
assert len(tickets) == 12
assert radar.ADVISORY_HEADING in tickets[0].description
assert all(ticket.description == DESCRIPTION for ticket in tickets[2:])
assert all(ticket.description == DESCRIPTION for ticket in tickets[1:])
assert len(pf.list_tickets()) == 12
assert len(pf.store.operational_events()) == 12

Expand Down
Loading