You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test TestWorkspaceApps/WorkspaceAppsProxySubdomain/ProxyError is failing with a timeout in the assertWorkspaceLastUsedAtUpdated function. The test expects the workspace's LastUsedAt timestamp to be updated after making a request to a workspace app, but this condition is never satisfied within the timeout period.
Key Error Message:
Error Trace: /Users/runner/work/coder/coder/coderd/workspaceapps/apptest/apptest.go:2475
Error: Condition never satisfied
Test: TestWorkspaceApps/WorkspaceAppsProxySubdomain/ProxyError
Test Flow:
Test makes a request to a fake workspace app via subdomain proxy
Expects HTTP 502 Bad Gateway response (which it gets)
Calls assertWorkspaceLastUsedAtUpdated to verify workspace usage tracking
The assertion fails because after.LastUsedAt.After(before.LastUsedAt) never becomes true
Root Cause Assessment
This appears to be a timing/race condition issue in the workspace app statistics collection system. The test expects that even failed requests (502 errors) should update the workspace's LastUsedAt timestamp, but the stats collection may be:
Asynchronous timing issue: The stats are collected asynchronously and may not be flushed within the test timeout
Race condition: The connection close event and stats collection may be racing
Failed request handling: The 502 error case may not be properly triggering usage stats updates
Reproduction
This failure occurred in the nightly gauntlet on macOS. The test may be flaky due to timing differences on different platforms or under different load conditions.
Related Code
Test file: coderd/workspaceapps/apptest/apptest.go (lines 1426-1438)
The test took approximately 30 seconds before failing, suggesting this is hitting the testutil.WaitLong timeout.
Pattern Analysis
This is the same failure pattern as previous occurrences:
Previous: 2025-09-03 (macOS), 2025-09-30 (see last comment)
Current: 2025-10-13 (Windows 2022)
Frequency: ~2 weeks between occurrences
Cross-platform: Affects both macOS and Windows
The test is consistently timing out waiting for the assertWorkspaceLastUsedAtUpdated assertion to pass, indicating the workspace LastUsedAt timestamp is not being updated after failed proxy requests (502 Bad Gateway).
This suggests the fix in coder/coder#19918 may not have fully resolved the underlying race condition in the workspace app statistics collection system.
Activity
chore: apptest: update test helpers to context-aware testutil.Eventua…
johnstcn commentedon Sep 23, 2025
Should be fixed by coder/coder#19918.
Please reopen if this is not the case.
ethanndickson commentedon Sep 30, 2025
Seen again https://github.com/coder/coder/actions/runs/18118376803/job/51558429062
blink-so commentedon Oct 13, 2025
New Occurrence - 2025-10-13
This test flaked again on the nightly gauntlet run.
CI Run Link: https://github.com/coder/coder/actions/runs/18454797808/job/52574332330
Commit: d9f95f22858bd8a94839b354ed902fa18428d1ac (main branch)
Platform: Windows 2022 (nightly-gauntlet)
Date: 2025-10-13 04:20:05 GMT
Test Result
The test took approximately 30 seconds before failing, suggesting this is hitting the
testutil.WaitLongtimeout.Pattern Analysis
This is the same failure pattern as previous occurrences:
The test is consistently timing out waiting for the
assertWorkspaceLastUsedAtUpdatedassertion to pass, indicating the workspaceLastUsedAttimestamp is not being updated after failed proxy requests (502 Bad Gateway).This suggests the fix in coder/coder#19918 may not have fully resolved the underlying race condition in the workspace app statistics collection system.
test(coderd/workspaceapps/apptest): fix lastusedat assertion for all …
flake-investigator commentedon Mar 12, 2026
New occurrence on Windows nightly-gauntlet:
TestWorkspaceApps/WorkspaceAppsProxySubdomain/ProxyError(packagegithub.com/coder/coder/v2/enterprise)Evidence from logs:
Root cause assessment:
assertWorkspaceLastUsedAtUpdatedtiming/race in workspace app stats flush (no panics/OOM/data races observed in logs).Assignment analysis:
git log --oneline -10 --follow coderd/workspaceapps/apptest/apptest.goshows recent functional changes by Cian Johnston: