Skip to content

Commit 2bf6c51

Browse files
committed
stabilize client reindexer test
A reindexer test was asserting the wrong contract for `Reindexer.TestSignals.Reindexed`. The test waited twice on the signal as though it fired once per index or once per startup cycle, but the reindexer sends it once after a run has finished processing all configured indexes. In the failing run, the client logged a complete reindex pass, including `Initiated reindex` for every default index, and then the test timed out waiting for another signal that would never arrive: https://github.com/riverqueue/river/actions/runs/24406465152 Configure the client with a single reindex target and wait for one `Reindexed` signal. That keeps this test focused on what it actually owns, which is proving that the client wires up the reindexer and lets a run complete through the full stack. The more detailed scheduling and multi-index behavior stay covered by the dedicated reindexer tests, so this client-level assertion no longer depends on the size of the default index list or on how long a full reindex pass happens to take on CI.
1 parent 5f19fc7 commit 2bf6c51

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

client_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5559,15 +5559,16 @@ func Test_Client_Maintenance(t *testing.T) {
55595559
t.Parallel()
55605560

55615561
config := newTestConfig(t, "")
5562+
config.ReindexerIndexNames = []string{"river_job_kind"}
55625563
config.ReindexerSchedule = &runOnceSchedule{}
55635564

55645565
client, _ := setup(t, config)
55655566

55665567
startAndWaitForQueueMaintainer(ctx, t, client)
55675568

55685569
svc := maintenance.GetService[*maintenance.Reindexer](client.queueMaintainer)
5569-
// There are two indexes to reindex by default:
5570-
svc.TestSignals.Reindexed.WaitOrTimeout()
5570+
// This client test only needs to prove the reindexer is wired up
5571+
// end-to-end. Use one configured index so it stays fast.
55715572
svc.TestSignals.Reindexed.WaitOrTimeout()
55725573
})
55735574
}

0 commit comments

Comments
 (0)