Skip to content
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

Fix integration test errors #14822

Closed
timvandermeij opened this issue Apr 22, 2022 · 4 comments · Fixed by #14836
Closed

Fix integration test errors #14822

timvandermeij opened this issue Apr 22, 2022 · 4 comments · Fixed by #14836
Assignees
Labels

Comments

@timvandermeij
Copy link
Contributor

I'm not entirely sure when this started happening, but recently all integration tests on the bots seem to fail; please see http://54.193.163.58:8877/e5b627524d19deb/output.txt for example. The stack trace is the following, which looking at #14293 could point to an upstream bug, but contrary to that issue this time it also involves the Windows bot and seemingly all tests instead of a single one:

  Message:
�[31m    ProtocolError: Protocol error (Target.createTarget): can't access property "addTab", tabBrowser is null addTab@chrome://remote/content/shared/TabManager.jsm:128:17
    createTarget@chrome://remote/content/cdp/domains/parent/Target.jsm:90:28
    execute@chrome://remote/content/cdp/domains/DomainCache.jsm:101:25
    execute@chrome://remote/content/cdp/sessions/Session.jsm:64:25
    onPacket@chrome://remote/content/cdp/CDPConnection.jsm:262:36
    onMessage@chrome://remote/content/server/WebSocketTransport.jsm:89:18
    handleEvent@chrome://remote/content/server/WebSocketTransport.jsm:71:14
    �[0m
  Stack:
    error properties: Object({ originalMessage: 'can't access property "addTab", tabBrowser is null' })
    ProtocolError: Protocol error (Target.createTarget): can't access property "addTab", tabBrowser is null addTab@chrome://remote/content/shared/TabManager.jsm:128:17
    createTarget@chrome://remote/content/cdp/domains/parent/Target.jsm:90:28
    execute@chrome://remote/content/cdp/domains/DomainCache.jsm:101:25
    execute@chrome://remote/content/cdp/sessions/Session.jsm:64:25
    onPacket@chrome://remote/content/cdp/CDPConnection.jsm:262:36
    onMessage@chrome://remote/content/server/WebSocketTransport.jsm:89:18
    handleEvent@chrome://remote/content/server/WebSocketTransport.jsm:71:14
        at C:\pdfjs\botio-files-pdfjs\private\e5b627524d19deb\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:75:24
        at new Promise (<anonymous>)
        at Connection.send (C:\pdfjs\botio-files-pdfjs\private\e5b627524d19deb\node_modules\puppeteer\lib\cjs\puppeteer\common\Connection.js:71:16)
        at Browser._createPageInContext (C:\pdfjs\botio-files-pdfjs\private\e5b627524d19deb\node_modules\puppeteer\lib\cjs\puppeteer\common\Browser.js:274:53)
        at BrowserContext.newPage (C:\pdfjs\botio-files-pdfjs\private\e5b627524d19deb\node_modules\puppeteer\lib\cjs\puppeteer\common\Browser.js:553:30)
        at Browser.newPage (C:\pdfjs\botio-files-pdfjs\private\e5b627524d19deb\node_modules\puppeteer\lib\cjs\puppeteer\common\Browser.js:267:37)
        at C:\pdfjs\botio-files-pdfjs\private\e5b627524d19deb\test\integration\test_utils.js:19:42
        at Array.map (<anonymous>)
        at exports.loadAndWait (C:\pdfjs\botio-files-pdfjs\private\e5b627524d19deb\test\integration\test_utils.js:18:32)
        at UserContext.<anonymous> (C:\pdfjs\botio-files-pdfjs\private\e5b627524d19deb\test\integration\annotation_spec.js:230:21)
  Message:
�[31m    TypeError: Cannot read property 'map' of undefined�[0m
  Stack:
        at exports.closePages (C:\pdfjs\botio-files-pdfjs\private\e5b627524d19deb\test\integration\test_utils.js:49:11)
        at UserContext.<anonymous> (C:\pdfjs\botio-files-pdfjs\private\e5b627524d19deb\test\integration\annotation_spec.js:234:13)
        at <Jasmine>
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
@Snuffleupagus
Copy link
Collaborator

/cc @calixteman

@calixteman
Copy link
Contributor

The last good run:
#14784 (comment)
The first failure is:
#14777 (comment)
The pushlog around these dates:
https://hg.mozilla.org/mozilla-central/pushloghtml?startdate=04%2F14%2F2022&enddate=04%2F16%2F2022

@Snuffleupagus
Copy link
Collaborator

It seems, when testing locally, that skipping the following test "fixes" things:

it("must execute WillSave and DidSave actions", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
await page.waitForFunction(
"window.PDFViewerApplication.scriptingReady === true"
);
try {
// Disable download in chrome
// (it leads to an error in firefox so the try...)
await page._client.send("Page.setDownloadBehavior", {
behavior: "deny",
});
} catch (_) {}
await clearInput(page, "#\\34 7R");
await page.evaluate(_ => {
window.document.activeElement.blur();
});
await page.waitForFunction(
`document.querySelector("#\\\\34 7R").value === ""`
);
let text = await actAndWaitForInput(page, "#\\34 7R", async () => {
await page.click("#download");
});
expect(text).withContext(`In ${browserName}`).toEqual("WillSave");
await page.waitForFunction(
`document.querySelector("#\\\\35 0R").value !== ""`
);
text = await page.$eval("#\\35 0R", el => el.value);
expect(text).withContext(`In ${browserName}`).toEqual("DidSave");
})
);
});

I recall that test having caused trouble in the past, see e.g. PR #14199, and I cannot help wonder if we now need to update that test-case to somehow work without the preference (since I'd imagine that it'll eventually be removed anyway)?

@calixteman calixteman self-assigned this Apr 25, 2022
@calixteman
Copy link
Contributor

It's related to:
https://hg.mozilla.org/mozilla-central/rev/a941cd19ec11
Locally, it works in removing the pref:

"browser.download.improvements_to_download_panel": false,

but in a m-c test an other pref has been added:
https://hg.mozilla.org/mozilla-central/diff/a941cd19ec11261de251c1c1cdcbae6da18fe835/toolkit/components/pdfjs/test/browser_pdfjs_savedialog.js
and locally it works too with this new one.

calixteman added a commit to calixteman/pdf.js that referenced this issue Apr 25, 2022
Snuffleupagus added a commit that referenced this issue Apr 25, 2022
Don't use pref 'browser.download.improvements_to_download_panel' in Firefox (#14822)
bh213 pushed a commit to bh213/pdf.js that referenced this issue Jun 3, 2022
rousek pushed a commit to signosoft/pdf.js that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants