Loading workspace insights... Statistics interval
7 days30 daysLatest CI Pipeline Executions
a097293a use env vars in global-setup (#34240)
## Current Behavior
The `runCommandUntil` e2e utility waits indefinitely for expected
output, causing tests to hang for hours in CI when servers fail to start
or produce different output. Additionally, `global-setup.ts` uses `npm
config set/delete` commands that modify global npm configuration,
polluting concurrent e2e test environments.
## Expected Behavior
Tests should timeout with clear error messages, and e2e setup should not
interfere with parallel test execution.
## Changes
### runCommandUntil timeout
- Added optional `timeout` parameter (default: 5 seconds)
- On timeout: kills process, logs collected output, rejects with
descriptive error
- Updated tests requiring longer startup time to pass explicit timeout
values
```typescript
// Existing tests work unchanged with 5s default
await runCommandUntil(`nx serve app`, (output) => output.includes('ready'));
// Tests needing more time specify explicit timeout
await runCommandUntil(`nx serve app`, (output) => output.includes('ready'), {
timeout: 30000
});
```
### global-setup environment isolation
- Replaced `execSync('npm config set ...')` with
`process.env['npm_config_//localhost:4873/:_authToken']`
- Replaced `execSync('npm config delete ...')` with `delete
process.env[...]` in teardown
- Removed unnecessary `npm config get registry` diagnostic call
- Environment variables are process-scoped and don't affect concurrent
test runs
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: FrozenPandaz <8104246+FrozenPandaz@users.noreply.github.com>