molecule-core/workspace-server/internal/pendinguploads
Molecule AI Core-DevOps e29b166f60
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 5s
sop-tier-check / tier-check (pull_request) Failing after 3s
fix(test): poll error counter to 0 before asserting in RecordsMetricsOnSuccess
Race-detector CI runs (-race) slow goroutines enough that a
prior sweeper goroutine (e.g. TestStartSweeper_TransientErrorDoesNotCrashLoop)
can still be running and incrementing pendingUploadsSweepErrors after
metricDelta() captures its baseline, but before the success-path sweeper
records its success metrics. The test then reads deltaError=1 instead of 0.

Fix: add waitForMetricDelta(t, deltaError, 0, 2*time.Second) before the
assertion, matching the polling pattern already used in the error-path
test (TestStartSweeper_RecordsMetricsOnError). This ensures the error
counter has settled before we assert on it.

Fixes molecule-core#22.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 23:27:19 +00:00
..
export_test.go [core-be-agent] fix(pendinguploads/test): correct sweeper test isolation 2026-05-09 22:30:28 +00:00
storage_test.go fix(chat-uploads): activity rows commit atomically with PutBatch 2026-05-05 21:34:28 -07:00
storage.go fix(chat-uploads): activity rows commit atomically with PutBatch 2026-05-05 21:34:28 -07:00
sweeper_test.go fix(test): poll error counter to 0 before asserting in RecordsMetricsOnSuccess 2026-05-09 23:27:19 +00:00
sweeper.go [core-be-agent] fix(pendinguploads/test): correct sweeper test isolation 2026-05-09 22:30:28 +00:00