Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): Increase timeout to stabilize e2e tests on MacOS x64 #2169

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
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
66 changes: 36 additions & 30 deletions packages/e2e-tests/test/test-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,39 +175,45 @@ export class TestShell {
}

async waitForPrompt(start = 0): Promise<void> {
await eventually(() => {
const output = this._output.slice(start);
const lines = output.split('\n');
const found = !!lines
.filter((l) => PROMPT_PATTERN.exec(l)) // a line that is the prompt must at least match the pattern
.find((l) => {
// in some situations the prompt occurs multiple times in the line (but only in tests!)
const prompts = l
.trim()
.replace(/>$/g, '')
.split('>')
.map((m) => m.trim());
// if there are multiple prompt parts they must all equal
if (prompts.length > 1) {
for (const p of prompts) {
if (p !== prompts[0]) {
return false;
await eventually(
() => {
const output = this._output.slice(start);
const lines = output.split('\n');
const found = !!lines
.filter((l) => PROMPT_PATTERN.exec(l)) // a line that is the prompt must at least match the pattern
.find((l) => {
// in some situations the prompt occurs multiple times in the line (but only in tests!)
const prompts = l
.trim()
.replace(/>$/g, '')
.split('>')
.map((m) => m.trim());
// if there are multiple prompt parts they must all equal
if (prompts.length > 1) {
for (const p of prompts) {
if (p !== prompts[0]) {
return false;
}
}
}
}
return true;
});
if (!found) {
throw new assert.AssertionError({
message: 'expected prompt',
expected: PROMPT_PATTERN.toString(),
actual:
this._output.slice(0, start) +
'[prompt search starts here]' +
output,
});
return true;
});
if (!found) {
throw new assert.AssertionError({
message: 'expected prompt',
expected: PROMPT_PATTERN.toString(),
actual:
this._output.slice(0, start) +
'[prompt search starts here]' +
output,
});
}
},
Comment on lines +203 to +236
Copy link
Contributor Author

@kraenhansen kraenhansen Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the above are merely a result of husky running prettier

{
// Increased timeout to account for slow startup on MacOS x64 hosts
timeout: 20_000,
}
});
);
}

waitForExit(): Promise<number> {
Expand Down
Loading