Skip to content

Flaky test: TestTemplateEdit/Autostop/startRequirement/BlockedNotEntitled #879

@blink-so

Description

@blink-so

Description

The test TestTemplateEdit/Autostop/startRequirement/BlockedNotEntitled is failing consistently across multiple CI runs and platforms (both Linux and macOS runners).

Test Details

This test verifies that when a user tries to edit template autostop requirements without the proper license entitlement, the operation should fail with a "license is not entitled" error.

The test:

  1. Creates a proxy server that returns entitlements without the advanced scheduling feature
  2. Attempts to set autostop requirements via the CLI
  3. Expects the operation to fail with a license error

Failure Evidence

Potential Causes

  1. Race condition: The entitlements check might happen before the proxy server is fully set up
  2. Timing issue: The client configuration with the proxy might not be properly established
  3. Test isolation: The test might be affected by other parallel tests

Suggested Investigation

  1. Add more logging to understand the exact failure mode
  2. Check if the proxy server is properly intercepting the entitlements request
  3. Verify the client is correctly configured to use the proxy
  4. Consider adding retry logic or better synchronization in the test setup

Impact

This flaky test is blocking CI and preventing legitimate changes from being merged. The test failure appears to be unrelated to the actual code changes being tested.

Related Files

  • /cli/templateedit_test.go (lines ~338-450)
  • /cli/templateedit.go (entitlements check logic)

cc: @coder/backend

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