Skip to content

test(ssh): fix flaky e2e test#19

Closed
loderunner wants to merge 2 commits intomainfrom
cursor/investigate-and-fix-flaky-ssh-e2e-test-d80a
Closed

test(ssh): fix flaky e2e test#19
loderunner wants to merge 2 commits intomainfrom
cursor/investigate-and-fix-flaky-ssh-e2e-test-d80a

Conversation

@loderunner
Copy link
Owner

Add waitForFile utility to e2e tests to prevent race conditions with server build artifacts.

A flaky e2e test was caused by a race condition where the test attempted to execute the compiled dist/server.js file before it was fully written and flushed to disk after the build() command completed. This resulted in SyntaxError: Unexpected token '}' when Node.js tried to parse an incomplete file. The waitForFile utility ensures the server executable is fully written and syntactically valid before tests proceed.


Open in Cursor Open in Web

Co-authored-by: charles.francoise <charles.francoise@circleci.com>
@cursor
Copy link

cursor bot commented Oct 28, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Co-authored-by: charles.francoise <charles.francoise@circleci.com>
@loderunner loderunner changed the title Investigate and fix flaky ssh e2e test test(ssh): investigate and fix flaky e2e test Oct 28, 2025
@loderunner loderunner changed the title test(ssh): investigate and fix flaky e2e test test(ssh): fix flaky e2e test Oct 28, 2025
@loderunner loderunner marked this pull request as ready for review October 28, 2025 10:39
@loderunner loderunner closed this Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants