test(purchase): stub RecoverStrandedApprovals late-completion mock to fix panic - #663
Conversation
… test does not panic When TransitionExecutionStatus returns an error, RecoverStrandedApprovals calls GetExecutionByID to distinguish a race (the row already left "approved") from a real store failure. The test TestManager_RecoverStrandedApprovals_LateCompletionNotClobbered had no expectation for GetExecutionByID, so testify panicked on the unstubbed call (mocks_test.go:277). Add a stub returning Status="completed" so the manager correctly skips the execution and the assertion (recovered==0) still genuinely proves that a row which completed between the stale SELECT and the recovery UPDATE is not clobbered by the sweep. Closes #657
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR fixes a test panic in ChangesRecovery Race Detection Test
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Closes #657. Stubs the GetExecutionByID call in the RecoverStrandedApprovals race-disambiguation path so the late-completion-not-clobbered test no longer panics on an unstubbed mock. Full internal/purchase suite green with -race (144 pass).
Summary by CodeRabbit