-
Notifications
You must be signed in to change notification settings - Fork 29
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
test(e2e): Add additional assertions to UI tests #2634
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f49d6a9
to
65ee3c4
Compare
If no sessions are available and the page needs to reload, we should wait to ensure that the page has loaded before checking what the state of the sessions are
Noticed an issue where a session recording was not playable. The theory is that the session didn't last long enough before it was cancelled. This adds a 2 second wait after establishing a connection before continuing.
0197b0d
to
7d02574
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just had a few more comments
}, | ||
); | ||
// Wait for 2 seconds to allow for a connection to establish | ||
await new Promise((resolve) => setTimeout(resolve, 2000)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this fix the flakiness? I'm wondering if it might be better to wrap the exec
in a promise and return that and that way you wait on any buffered text as a response and can inspect stdout/stderr?
We do something similar here
boundary-ui/ui/desktop/electron-app/src/helpers/spawn-promise.js
Lines 104 to 128 in 401ff35
spawn(command, options) { | |
return new Promise((resolve, reject) => { | |
const childProcess = spawn(path, command, options); | |
childProcess.stdout.on('data', (data) => { | |
resolve({ childProcess, stdout: data.toString() }); | |
}); | |
childProcess.stderr.on('data', (data) => { | |
resolve({ childProcess, stderr: data.toString() }); | |
}); | |
childProcess.on('error', (err) => reject(err)); | |
// In case the process has no stdio and didn't error out, resolve a | |
// promise once the child process closes so we're not waiting forever. | |
// Windows doesn't seem to return any error nor any output from stderr when | |
// a timeout occurs so this guarantees we return a response to the caller. | |
// Otherwise this should not get hit as we should be returning a response | |
// from one of the handlers above. | |
childProcess.on('close', () => | |
resolve({ | |
childProcess, | |
stderr: JSON.stringify({ error: 'Process was closed.' }), | |
}), | |
); | |
}); | |
}, |
- Use .all() when looping - Add check to see if we need to reload the page or not
Ran into a conflict with the Static/Dynamic host catalog type and the Static/Dynamic credential type.
Description
This PR is a follow-up to this comment: #2563 (comment)
This PR adds additional assertions to UI tests, specifically, ensuring that a session is successfully created after setting up resources via the Admin UI.
How to Test
Run e2e tests
Checklist
https://hashicorp.atlassian.net/browse/ICU-15765