Skip to content

flake: TestAPI/Create #19434

@blink-so

Description

@blink-so

Problem

The nightly gauntlet is failing on macOS due to test failures in agent/agentcontainers. The issue is a path mismatch in mock expectations where tests expect paths without the /private prefix, but macOS is resolving them with /private.

Failed run: https://github.com/coder/coder/actions/runs/17088219216
Commit: 60d611f

Error Details

Multiple test cases in TestAPI/Create are failing with:

expected call at /Users/runner/work/coder/coder/agent/agentcontainers/api_test.go:2468 doesn't match the argument at index 2.
Got: /private/var/folders/rs/pdkp4bzs6r53dmgkthjgwkpm0000gn/T/go-build1803124527/b1322/agentcontainers.test (string)
Want: is equal to /var/folders/rs/pdkp4bzs6r53dmgkthjgwkpm0000gn/T/go-build1803124527/b1322/agentcontainers.test (string)

Affected Tests

  • TestAPI/Create/Name
  • TestAPI/Create/AppDeduplication
  • TestAPI/Create/WithApps
  • TestAPI/Create/WithSomeDisplayAppsDisabled
  • TestAPI/Create/WithAllDisplayApps
  • TestAPI/Create/WithDefaultDisplayApps

Root Cause

On macOS, /var is a symlink to /private/var, and the system is resolving the full path including the /private prefix. The mock expectations in the tests need to account for this macOS-specific behavior.

Solution

The mock expectations should either:

  1. Use path resolution to handle the /private prefix on macOS
  2. Normalize paths before comparison
  3. Use more flexible path matching in the mocks

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