test: drop bash login/rc loading in spawnSync invocations#3393
Merged
Conversation
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
E2E Advisor RecommendationRequired E2E: None Full advisor summaryPi Semantic E2E AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
Signed-off-by: Tinson Lai <tinsonl@nvidia.com>
ericksoa
approved these changes
May 13, 2026
Contributor
ericksoa
left a comment
There was a problem hiding this comment.
Reviewed the test-only bash invocation cleanup. I verified the focused changed-test suite and CLI build locally; product regression risk is very low because this only changes host-side test harness shell startup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Several test files use
bash -lc/bash --norc -lcfor one-off helpers (command -vlookups, sourcing local helper scripts, piping into mkfifo). The-lflag loads the user's login profile (/etc/profile,~/.bash_profile, etc.). On developer machines whose shells source heavier per-login customisations, that adds noticeable startup cost per invocation, and with N invocations per test the cumulative wall time can exceed vitest's default 5s test timeout — even though each spawn does no useful work in login mode. Other invocations in the suite are paying the same tax silently because their per-test timeouts are higher than the wall time they currently use.Switch host-side test spawns to
bash --noprofile --norc -c: no login, no rc, equivalent functionality. Production code paths that intentionally run user-facing commands in login mode (onboard.ts,create-stream.ts,actions/update.ts) are left untouched, as aresandbox exec ... -- sh -lcinvocations (those run inside the sandbox where login mode is required for correct PATH).Changes
test/secret-redaction.test.ts:bash -lc 'command -v <name>'inside the 10-iteration symlink-building loop in the debug.sh wrapper test.test/nemoclaw-start.test.ts:runGuardedOpenclawhelper. Already passesenv: { ...process.env, PATH: ... }, so it never needed profile loading.test/credentials.test.ts: two pipe-based prompt tests.test/runtime-shell.test.ts:runShellhelper used by many runtime-shell assertions.test/smoke-macos-install.test.ts: mkfifo/IFS pipe pattern.test/install-preflight.test.ts: twocommand -v python3lookups.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Signed-off-by: Tinson Lai tinsonl@nvidia.com
Summary by CodeRabbit