-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Failing GitHub Actions font-test was marked as successful #17396
Comments
Yikes, that's not great indeed. I'll have a look at that. |
I have managed to reproduce the issue by putting back the code from #17172 (comment) (it talks about an invalid browsing context in BiDi which is what we also see here) and a hothacked Putting back the page closing lines is required to trigger the @whimboo @OrKoN Does this perhaps ring a bell for you, also given the comment at #17172 (comment) which was needed for BiDi? The exception in Puppeteer is triggered as soon as |
As a temporary solution, depending on how difficult/time-consuming a proper fix is, could we do something similar to the old botio font-test and check that the success message is being logged and manually throw an exception? |
Yes, I think that could work as a temporary solution indeed. Let's await a response to the message above, and if it's indeed an upstream issue that we can't fix here we can decide to:
|
This is indeed strange. So when a browsing context gets destroyed in the browser it's basically gone after the @sadym-chromium could you maybe help while @OrKoN is away? |
@whimboo could you please provide a link to the test in |
I don't know which exact test fails here but see the initial comment with a link to the CI log. All the font tests can be found at https://github.com/mozilla/pdf.js/tree/master/test/font. @timvandermeij and @Snuffleupagus could you may give more details about the code that actually triggers this exception? |
This breaks when run, on Windows, as part of this GitHub Actions workflow: https://github.com/mozilla/pdf.js/blob/master/.github/workflows/font_tests.yml |
I have been working on creating a reduced test case that would demonstrate the issue in isolation, and while doing this I found that I had been chasing a red herring in my previous analysis where I thought the Puppeteer exception didn't bubble up to our test runner. It turns out it actually does, and that is an issue in our test runner that has been there since basically "forever" (I could trace it back to a commit from 7 years ago). For some reason we never noticed this before, but the following code is problematic here: https://github.com/mozilla/pdf.js/blob/master/gulpfile.mjs#L693-L695 The issue that we take the exit code from the spawned Node.js process and then... do nothing with it. This pattern exists in more places, so that's something we can fix on our end, and we should also audit the other similar call sites. However, if we do that now the builds will actually fail and likely block merging PRs, so we still need to do something about the Puppeteer exception being raised in the first place, so one of the options from #17396 (comment). Strangely this only happens on Windows in our CI, and I also can't reproduce it on Linux at all. However, it does happen consistently in the CI; the most recent run is https://github.com/mozilla/pdf.js/actions/runs/7173542922/job/19533117343 and for completeness I'm listing the full traceback here:
Does the traceback perhaps provide any hints as to why the browsing context in Puppeteer could be I'm not sure how useful this is, but in an attempt to help with reproducing this I have tried to construct a reduced test case of how we use Puppeteer (note that we no longer have the page closing loop because that's indeed unnecessary, but we had it before and was seen to be problematic in #17172 (comment) so it might help with triggering the bug), so perhaps this can be used for reproducing/debugging on Windows: import puppeteer from "puppeteer";
async function reproduce() {
const browser = await puppeteer.launch({
product: "firefox",
protocol: "webDriverBiDi",
headless: false,
});
const page = await browser.newPage();
for (const page of await browser.pages()) {
await page.close();
}
await browser.close();
}
await reproduce(); Save this as pdf.js/test/unit/testreporter.js Line 57 in 76e3e52
in the traceback. However, after that it seems to crash because no actual Jasmine tests are run. I hope this all helps to debug the issue, and if I can somehow provide more information, feel free to let me know. |
Thank you for the update Tim! To get even more details of what might go wrong I would suggest the following:
I could then have a look at the logs tomorrow to see what might go wrong on our side. But you could also additionally add the |
@whimboo Sorry for the delay here. I have made #17432 to apply the debugging suggestions you mentioned (removed all other workflows and limited the font tests workflow to just Windows to make sure the logs are as usable as possible). You can find the build here but since I don't know how long the retention is I have also downloaded the full raw logs and attach them here as logs.txt. Fortunately on Windows the run crashes pretty quickly after Puppeteer has started, but it's still quite a bit of logs that I hope will be helpful for debugging the issue. The final logs when the exception happens are:
This looks interesting to me; I'm not sure what "chrome://gfxsanity/content/sanitytest.html" is exactly, but maybe that's the anomaly that causes this only on Windows somehow since I don't recognize this URL as something that we use or trigger ourselves. |
Oh wow! Yes, this is indeed a problem with the sanity test window then! This window should not be used at all and we have it disabled for geckodriver and Marionette but forgot about it in Puppeteer. So temporarily you could set the preference |
I've created a PR for Puppeteer so that it should be fixed with the next release. |
@whimboo I have created #17457 and can confirm that setting |
A new puppeteer release is out which contains my fix: So you could get this issue fixed by upgrading Puppeteer. CC @calixteman. |
I'm reopening this because even though the upstream issue is fixed now we still need to update our Gulpfile to not ignore non-zero exit codes, to prevent this from going by unnoticed again in the future. |
In a recent PR the font-tests failed completely on Windows, however the GitHub Actions workflow didn't actually catch the failure which means that the test was marked as successful: https://github.com/mozilla/pdf.js/actions/runs/7150415038/job/19473662790?pr=17395#step:8:20
That seems quite bad, since it means that we could very easily overlook a failing test. (Running
gulp fonttest
locally on Windows works fine though, so I'm not sure how to debug this.)/cc @timvandermeij Any ideas here?
The text was updated successfully, but these errors were encountered: