Skip to content

flake: TestAPI/Create #917

@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: 60d611fc78fdbd85618b49f489e1ef022003568f
Public issue: coder/coder#19434

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

Assignment

Assigning to @DanielleMaywood as the most recent contributor to the failing test file.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions