aws / aws/aws-toolkit-vscode

unreliable test: "Failed to launch the browser process" in E2E tests

Open
#4,283 0 comments 0 reactions 0 assignees View on GitHub
tests-ci-cd
Dominant language
TypeScript
Stars
2k
Forks
807
Avg merge
10h 12m
Merged PRs (30d)
7

Description

# Problem

E2E tests sometimes fail with:

```
1) Test how this codebase uses the CodeCatalyst API
"before all" hook in "Test how this codebase uses the CodeCatalyst API":
Error: Failed to launch the browser process!
prctl(PR_SET_NO_NEW_PRIVS) failed
[0115/181353.778785:FATAL:zygote_communication_linux.cc(270)] Cannot communicate with zygote

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

at invokeLambda (src/test/setupUtil.ts:180:23)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object. (src/test/setupUtil.ts:232:21)
at async openSsoUrl (src/auth/sso/model.ts:108:28)
at async SsoAccessTokenProvider.authorize (src/auth/sso/ssoAccessTokenProvider.ts:177:15)
at async SsoAccessTokenProvider.runFlow (src/auth/sso/ssoAccessTokenProvider.ts:113:20)
at async SsoAccessTokenProvider.createToken (src/auth/sso/ssoAccessTokenProvider.ts:102:24)
at async Auth.createConnection (src/auth/auth.ts:285:51)
at async useCodeCatalystSsoConnection (src/testE2E/codecatalyst/client.test.ts:448:49)
at async createTestCodeCatalystClient (src/testE2E/codecatalyst/client.test.ts:427:22)
at async /codebuild/output/src2597991457/src/github.com/aws/aws-toolkit-vscode/src/testE2E/codecatalyst/client.test.ts:105:22
at async Context. (src/testE2E/codecatalyst/client.test.ts:101:9)

globalSetup: after()
Error: 1 tests failed.
at /codebuild/output/src2597991457/src/github.com/aws/aws-toolkit-vscode/src/test/testRunner.ts:90:28
at MultiReporters.done (/codebuild/output/src2597991457/src/github.com/aws/aws-toolkit-vscode/node_modules/mocha-multi-reporters/lib/MultiReporters.js:124:16)
at done (/codebuild/output/src2597991457/src/github.com/aws/aws-toolkit-vscode/node_modules/mocha/lib/mocha.js:1007:16)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
[main 2024-01-15T18:13:54.301Z] Extension host with pid 2638 exited with code: 0, signal: unknown.
```

# Expected behavior

E2E tests should be reliable.

- If this issue is intermittent, the test harness should retry to avoid false CI failures.
- The root cause of the issue should be documented in https://github.com/aws/aws-toolkit-vscode/blob/master/docs/TESTPLAN.md

Contributor guide

Open the contributing guide

Research direction

Start with the browser-launch path in src/test/setupUtil.ts, especially the calls around lines 180 and 232, and reproduce the failure through src/testE2E/codecatalyst/client.test.ts. Trace how the E2E harness handles this setup failure. Done means intermittent browser-launch failures no longer cause false CI failures through the requested harness behavior, and the root cause and handling are documented in docs/TESTPLAN.md.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.