Skip to content

Flaky WorkspaceWaitingApprovalFilterTest drops wa-filter-3-last-only in CI #3972

Closed

Description

@dhananjay6561

Bug description 🐞

WorkspaceWaitingApprovalFilterTest.waitingApprovalFilterFindsWorkspacesWhoseLastJobStatusIsSomethingElse fails intermittently in build-jammy, on PRs that don't touch workspace filtering. The result is missing wa-filter-3-last-only, the workspace that has lastJobStatus = waitingApproval and no job rows at all.

Seen failing on:

Steps to reproduce

Run the full api test suite in CI a few times. Locally the test passes on its own and alongside OrganizationTests, WorkspaceTests and the TFE tests, so it looks order or timing dependent.

Expected behavior

The filter returns wa-filter-1-hidden, wa-filter-2-two and wa-filter-3-last-only every run.

Anything else?

One possible lead, not confirmed: wa-filter-3-last-only is the only fixture with no job rows, and something else in the context (for example a scheduled status update like the InitWorkspaceStatus "has no jobs to update status" path) may reset its lastJobStatus while the test runs. Happy to dig in further if that helps.

Activity

  1. dhananjay6561 commented on Nov 20, 2026

    @dhananjay6561
    ContributorAuthor

    @alfespa17 @jakegroves @Macbet tracked this down: it's JobReconciliationSweep (every 30s) repairing wa-filter-3-last-only to NeverExecuted when a tick lands between the fixture insert and the query. The failing CI log shows the sweep doing it at 21:59:00, one second before the failure. Fix is in #3973.

  2. dhananjay6561 commented on Nov 21, 2026

    @dhananjay6561
    ContributorAuthor

    Fixed by #4001, which disables the reconciliation sweep in the test profile so it can't rewrite this fixture mid-test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions