Skip to content

test(scheduler): Lambda no-refresh tests pass vacuously since #932 #962

Closed

Description

@cristim

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.

Test-only. No production behaviour change.

Activity

  1. IAmJSD commented on Oct 16, 2026

    @IAmJSD
    Collaborator

    Claiming: working on this

  2. self-assigned this
    on Oct 16, 2026
  3. added a commit that references this issue on Oct 16, 2026
    73e9813
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions