Uh oh!
There was an error while loading. Please reload this page.
Reduce wait-for instructions for rustdoc GUI tests - #95172
Conversation
I’d really rather not mess with these numbers unless someone’s complaining about them becoming the long pole in the test suite. Making them shorter will increase the number of intermittent failures, when these tests run on a computer with a noisy neighbor. Could these tests be tweaked to poll for some criteria to be fulfilled, instead of just waiting for a fixed amount of time? For example, could the wait-for instruct be modified to take both a time and a selector? |
GuillaumeGomez
commented
Mar 21, 2022
It already can. It's just that in some cases, waiting for a selector isn't working because the CSS changes associated to it haven't been computed by the browser yet. I only changed the biggest ones because the 1 second wait for example is just way too much. |
notriddle
commented
Mar 21, 2022
Could assert-css be extended with a timeout parameter, so that instead of just failing the first time it observed a failing match, it can instead poll for a while until it either observed a match or times out and fails? |
GuillaumeGomez
commented
Mar 21, 2022
That could. Not sure if it's a good idea though... |
notriddle
commented
Mar 21, 2022
I've done browser UI tests (not with your framework, just Selenium-PHP), and wound up with a test suite that took hours to run while consuming less than 1% CPU. Redesigning it to use a function that pretty much does what "assert-css with a timeout param" would do improved it a lot, cutting runtime by more than half, while also pretty much eliminating intermittent test failures. But, on the other hand, that project was strange in a lot of ways, so I'm not sure how reflective of rustdoc it'll be. |
GuillaumeGomez
commented
Mar 21, 2022
I could add a command |
notriddle
commented
Mar 21, 2022
Sure, that would be great. Thanks! |
GuillaumeGomez
commented
Mar 21, 2022
I opened GuillaumeGomez/browser-UI-test#286. I'll try to do it in the next days. |
5757dfe to
ec96926Compareec96926 to
e0a697aCompareGuillaumeGomez
commented
Mar 25, 2022
@notriddle Thanks to your great suggestion, almost all "random amount of time" waits have been removed! \o/ |
notriddle
commented
Mar 25, 2022
@bors r+ |
bors
commented
Mar 25, 2022
📌 Commit e0a697a has been approved by |
bors
commented
Mar 25, 2022
bors
commented
Mar 26, 2022
☀️ Test successful - checks-actions |
rust-timer
commented
Mar 27, 2022
Finished benchmarking commit (a2ebd5a): comparison url. Summary: This benchmark run did not return any relevant results. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
r? @notriddle