Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tests/legacy-cli/e2e/utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ ts_project(
"//:node_modules/verdaccio",
"//:node_modules/verdaccio-auth-memory",
"//tests:node_modules/@types/tar-stream",
"//tests:node_modules/rxjs",
"//tests:node_modules/tar-stream",
"//tests:node_modules/tree-kill",
],
Expand Down
25 changes: 14 additions & 11 deletions tests/legacy-cli/e2e/utils/process.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { spawn, SpawnOptions } from 'node:child_process';
import * as child_process from 'node:child_process';
import { concat, defer, EMPTY, from, lastValueFrom, catchError, repeat } from 'rxjs';
import { getGlobalVariable, getGlobalVariablesEnv } from './env';
import treeKill from 'tree-kill';
import { delimiter, join, resolve } from 'node:path';
Expand Down Expand Up @@ -310,7 +309,7 @@ export async function execAndCaptureError(
}
}

export function execAndWaitForOutputToMatch(
export async function execAndWaitForOutputToMatch(
cmd: string,
args: string[],
match: RegExp,
Expand All @@ -322,15 +321,19 @@ export function execAndWaitForOutputToMatch(
// happened just before the build (e.g. `git clean`).
// This seems to be due to host file system differences, see
// https://nodejs.org/docs/latest/api/fs.html#fs_caveats
return lastValueFrom(
concat(
from(_exec({ waitForMatch: match, env }, cmd, args)),
defer(() => waitForAnyProcessOutputToMatch(match, 2500)).pipe(
repeat(20),
catchError(() => EMPTY),
),
),
);
const maxRetries = 20;
let lastResult = await _exec({ waitForMatch: match, env }, cmd, args);

for (let i = 0; i < maxRetries; i++) {
try {
lastResult = await waitForAnyProcessOutputToMatch(match, 2500);
} catch {
// If we timeout (no new match found), we assume the process is stable.
break;
}
}

return lastResult;
} else {
return _exec({ waitForMatch: match, env }, cmd, args);
}
Expand Down
1 change: 0 additions & 1 deletion tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"devDependencies": {
"@types/tar-stream": "3.1.4",
"@angular-devkit/schematics": "workspace:*",
"rxjs": "7.8.2",
"tar-stream": "3.1.7",
"tree-kill": "1.2.2"
}
Expand Down