Wait on CardDone and materialActive release in lifecycle test #176

Merged
weichen merged 1 commits from fix/material-intake-lifecycle-flake into main 2026-10-12 06:32:43 +00:00
Owner

Summary

  • Fix flake in TestMaterialIntakeAttachmentOnlyLifecycle by waiting on the same gates materialExisting uses (CardDone + materialActive released) instead of systemTexts.
  • deliverNotices runs before defer materialKeyRelease, so notice-first waits could still see the in-memory key and get pending dedup.

Why

CI test / test-pg had intermittent failures on this case (same code red/green). No production change.

Evidence

  • SELF: go test ./internal/runmgr/ -run TestMaterialIntakeAttachmentOnlyLifecycle -count=20 (pass)

Test plan

  • Local stress -count=20
  • Backend CI green on this PR
## Summary - Fix flake in `TestMaterialIntakeAttachmentOnlyLifecycle` by waiting on the same gates `materialExisting` uses (`CardDone` + `materialActive` released) instead of `systemTexts`. - `deliverNotices` runs before `defer materialKeyRelease`, so notice-first waits could still see the in-memory key and get pending dedup. ## Why CI `test` / `test-pg` had intermittent failures on this case (same code red/green). No production change. ## Evidence - SELF: `go test ./internal/runmgr/ -run TestMaterialIntakeAttachmentOnlyLifecycle -count=20` (pass) ## Test plan - [x] Local stress `-count=20` - [ ] Backend CI green on this PR
weichen added 1 commit 2026-10-12 06:31:48 +00:00
Wait on CardDone and materialActive release in lifecycle test
ci / vet-and-test (pull_request) Successful in 46s
c963347e52
Why: TestMaterialIntakeAttachmentOnlyLifecycle flaked when waiting on
systemTexts; deliverNotices runs before defer materialKeyRelease, so
done-dedup still saw the in-memory key and returned pending.
Evidence: go test ./internal/runmgr/ -run TestMaterialIntakeAttachmentOnlyLifecycle -count=20
Impact: Aligns the wait with materialExisting gates; no production change.
Refs: fix/material-intake-lifecycle-flake

Co-authored-by: Cursor <cursoragent@cursor.com>
weichen merged commit 5e8ada727c into main 2026-10-12 06:32:43 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#176