-
Notifications
You must be signed in to change notification settings - Fork 10
[RW-8091][risk=no] Rework nightly egress test #6536
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
Conversation
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.
LGTM! I have few minor and non-blocking comments. Also, do we want to clean up notebook/runtime/workspace at the end of test?
e2e/app/page/notebook-page.ts
Outdated
.then((e) => e.click()); | ||
await findAndClickCheckbox(); | ||
|
||
const handleDialog = (d) => this.acceptDataUseDownloadDialog(treePage, d); |
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.
Question: since acceptDataUseDownloadDialog
is an async func, I believe this func need to be async like const handleDialog = asyc (d) => await this.acceptDataUseDownloadDialog(treePage, d);
?
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.
You need the async
keyword if you want to use await
in your function, that's it. In this case, there is no need to use the await keyword, therefore we don't need it to be an async function. What you've written is functionally equivalent to what I wrote, but with extra steps.
It will be difficult to explain this in a comment - lets stay on and talk through it after eng sync, if you want.
e2e/app/page/notebook-page.ts
Outdated
await findAndClickCheckbox(); | ||
|
||
const handleDialog = (d) => this.acceptDataUseDownloadDialog(treePage, d); | ||
treePage.on('dialog', handleDialog); |
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.
suggestion: treePage.once
is a good alternative to treePage.on
and treePage.off
.
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.
Good find, thanks - I hadn't seen once
. That said, on/off is slightly more hermetic. There is no guarantee that your handler actually gets called within the scope of this method, e.g. if the alert stopped showing up in certain cases, or there was a product change that removed it. If that were to occur, with once you would be leaking a dialog listener into unrelated sections of the test.
once/off may be an improvement here. I'm also thinking the off
should be further down.. I'm slightly concerned now about a race condition between the dialog showing up, and the off
call.
Another alternative would be once
+ assert that your listener was invoked. That could be the best option if what we're trying to do here is actually test the modal behavior.
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.
👍🏻 I like once + assert
too.
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.
I switched to this, and it exposed the fact that indeed we're not always getting the modal on upload/download. I suspect this is a race condition between clicking upload, and when the Jupyter extension (which adds the modal) is installed. I added another unfortunate sleep here to cover this situation.
Open to other suggestions. I also filed https://precisionmedicineinitiative.atlassian.net/browse/RW-8144 which will give generic support for page.waitForNetworkIdle()
, which is something I wanted to try here.
{ visible: true } | ||
) | ||
.then((e) => e.click()); | ||
await findAndClickCheckbox(); |
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.
I ran this test locally several times. 1 time it had failed. Unfortunately, after e.click(()
, it needs a short sleep for improved event synchronization.
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.
Thanks for testing this out locally. Do you still have the test logs from when you saw this error?
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.
Also, are you sure it was this line and not L143? I see a pretty clear potential race condition there.
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.
Not anymore. It was overwritten after I made few local changes. I thought it could happen again if I rerun again. But failure only happened once.
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.
yes, it was at line 143: after click Download button. my comment was at the wrong line.
e2e/app/page/notebook-page.ts
Outdated
|
||
// Upload button that triggers file selection dialog. | ||
const handleDialog = (d) => this.acceptDataUseUploadDialog(newPage, d); | ||
newPage.on('dialog', handleDialog); |
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.
suggestion: Use newPage.once
.
RE cleanup runtime: there might be complications doing this since the user will be security suspended at that point in the test. For now I'd like to avoid adding more points of failure and just let the cron handle these. |
Previous test would occasionally fail when uploading to this speedtest site, this is a flaky external dependency. Instead, we now create a six 30MB dummy files and download them in serial.
Also: update prompt handling logic within notebooks to cleanup its own handlers