-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improve end2end runner log #41
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
const UPDATE_INTERVAL = 250; | ||
async function pollIncrementalResults(driver, resolve) { |
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.
Why poll the incremental results rather than have the driver push them?
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.
How did you imagine pushing them from the page to the outer test runner?
I tried to just forward console.log to the outer test runner (this would have been the easiest solution IMO) but somehow that didn't work with selenium (most likely I'm missing something here, but I gave up and resorted to the current approach).
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'm not sure how to do it in Selenium. I'll ask internally though.
One option would be to have the JetStreamDriver send POST
requests to server.mjs
(like reportScoreToRunBenchmarkRunner
) and either have the server log those messages or have the runner provide a callback to the server.
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.
If I can read console.log messages consistently that would be the prefered solution 👍 .
As for server logging: I could give a custom lws middleware a shot that just prints a posted json payload
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.
Unfortunately, it doesn't look like Safari has a way to get the console.log messages. If reading an HTTP POST is annoying you could make a "JetStreamConsoleLog" custom event and do
const originalLog = console.log.bind(console);
console.log = function log() {
globalThis.dispatchEvent(new CustomEvent("JetStreamConsoleLog", {
detail: arguments.toString();
}));
originalLog.call(...arguments);
}
In JetStreamDriver.js
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 can give it a shot again with listening to events. The last time I tried you basically don't get any callback within selenium, since the main message loop is fully saturated with jetstream. The main blocking issue was that I couldn't add new globals in Firefox, but I didn't try modifying existing objects.
Probably the custom post-message middleware for LWS is going to be easiest choice here here.
Add more test logging to make it easier to debug a failing test.
We're currently still lacking basic result validation and checking whether any errors have been thrown.