You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(scheduler): Lambda no-refresh tests pass vacuously since #932 #962
Two scheduler tests no longer test anything since #932: TestScheduler_ListRecommendations_LambdaSkipsBackgroundRefresh (internal/scheduler/scheduler_test.go:1060) and TestScheduler_ListRecommendations_ColdStart_Lambda_NeverMarksOrCollects (:1118).
Why
#932 made ListRecommendations kick a cold-start or stale-cache collection only when the context carries WithBackgroundCollection, via mayCollect := BackgroundCollectionAllowed(ctx) (scheduler.go:~1153). These two tests still call it with a plain context.Background(). Nothing is ever collected, whether or not the Lambda guard exists.
Evidence
During the independent review of #960, the !s.isLambda condition at scheduler.go:~1183 was removed in a scratch copy, and both tests still passed. The same review did not probe the isLambda guards at scheduler.go:~1452 and ~1502.
#960 fixed the same problem for the stale-refresh tests that #938 added.
Fix
Run both tests with WithBackgroundCollection(context.Background()), so the only thing preventing collection is the Lambda guard.
Confirm each test fails when its isLambda guard is removed.
Check the guards at ~1452 and ~1502 for the same gap.
Activity
IAmJSD commentedon Oct 16, 2026
Claiming: working on this
test(scheduler): make the Lambda no-refresh tests bite again (LeanerC…
test(scheduler): make the LambdaGuard control catch a non-blocking ha…