Closed Bug 1789544 Opened 4 years ago Closed 8 months ago

Intermittent TEST-UNEXPECTED-TIMEOUT | Screenshots Page.screenshot should run in parallel in multiple pages (screenshot.spec.js) | expected PASS

Categories

(Remote Protocol :: Agent, defect, P5)

defect

Tracking

(firefox149 wontfix, firefox150 fixed)

RESOLVED FIXED
150 Branch
Tracking Status
firefox149 --- wontfix
firefox150 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: jdescottes)

References

Details

(Keywords: intermittent-failure)

Filed by: mlaza [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=389681808&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/b-W4z7dFQZW_mHzmBL5pqw/runs/1/artifacts/public/logs/live_backing.log


[task 2022-09-07T00:21:03.982Z] TEST-START | Screenshots Page.screenshot should run in parallel in multiple pages (screenshot.spec.js)
[task 2022-09-07T00:21:03.982Z] PID 439 | ["test-start",{"title":"should run in parallel in multiple pages","fullTitle":"Screenshots Page.screenshot should run in parallel in multiple pages","file":"/builds/worker/checkouts/gecko/remote/test/puppeteer/test/build/screenshot.spec.js","currentRetry":0}]
[task 2022-09-07T00:21:03.983Z] PID 439 | 1662510063983	CDP	TRACE	CDPConnection efa2756b-15c0-4436-afce-6a17eaf1a75d -> {"method":"Target.createBrowserContext","params":{},"id":109}
[task 2022-09-07T00:21:03.984Z] PID 439 | 1662510063984	CDP	TRACE	CDPConnection efa2756b-15c0-4436-afce-6a17eaf1a75d <- {"id":109,"result":{"browserContextId":11}}
[task 2022-09-07T00:21:03.985Z] PID 439 | 1662510063984	CDP	TRACE	CDPConnection efa2756b-15c0-4436-afce-6a17eaf1a75d -> {"method":"Target.createTarget","params":{"url":"about:blank","browserContextId":11},"id":110}
[task 2022-09-07T00:21:03.991Z] PID 439 | 1662510063989	CDP	TRACE	CDPConnection efa2756b-15c0-4436-afce-6a17eaf1a75d <- {"method":"Target.targetCreated","params":{"targetInfo":{"targetId":"d6102354-4ec6-4564-96e0-c5a7ee77be18","type":"page","title":"","url":"about:blank","attached":false,"browserContextId":11}}}
[task 2022-09-07T00:21:03.997Z] PID 439 | 1662510063996	RemoteAgent	TRACE	Received DOM event TabSelect for [object XULElement]
[task 2022-09-07T00:21:04.008Z] PID 439 | 1662510064007	CDP	TRACE	CDPConnection efa2756b-15c0-4436-afce-6a17eaf1a75d <- {"id":110,"result":{"targetId":"d6102354-4ec6-4564-96e0-c5a7ee77be18"}}
...
[task 2022-09-07T00:21:04.712Z] PID 439 | 1662510064711	CDP	TRACE	CDPConnection efa2756b-15c0-4436-afce-6a17eaf1a75d <- {"method":"Page.loadEventFired","params":{"timestamp":1662510064.711},"sessionId":"3162eb7d-2d3e-484a-82b3-48f4dd84b7aa"}
[task 2022-09-07T00:21:04.712Z] PID 439 | 1662510064711	CDP	TRACE	CDPConnection efa2756b-15c0-4436-afce-6a17eaf1a75d <- {"method":"Target.receivedMessageFromTarget","params":{"sessionId":"3162eb7d-2d3e-484a-82b3-48f4dd84b7aa","message":"{\"method\":\"Page.loadEventFired\",\"params\":{\"timestamp\":1662510064.711}}"}}
[task 2022-09-07T00:21:04.713Z] PID 439 | 1662510064712	CDP	TRACE	CDPConnection efa2756b-15c0-4436-afce-6a17eaf1a75d <- {"method":"Page.lifecycleEvent","params":{"frameId":"19","loaderId":"57372173140067","name":"load","timestamp":1662510064.711},"sessionId":"3162eb7d-2d3e-484a-82b3-48f4dd84b7aa"}
[task 2022-09-07T00:21:04.713Z] PID 439 | 1662510064712	CDP	TRACE	CDPConnection efa2756b-15c0-4436-afce-6a17eaf1a75d <- {"method":"Target.receivedMessageFromTarget","params":{"sessionId":"3162eb7d-2d3e-484a-82b3-48f4dd84b7aa","message":"{\"metho ... cleEvent\",\"params\":{\"frameId\":\"19\",\"loaderId\":\"57372173140067\",\"name\":\"load\",\"timestamp\":1662510064.711}}"}}
[task 2022-09-07T00:21:04.714Z] PID 439 | 1662510064712	CDP	TRACE	CDPConnection efa2756b-15c0-4436-afce-6a17eaf1a75d <- {"method":"Page.frameStoppedLoading","params":{"frameId":"19"},"sessionId":"3162eb7d-2d3e-484a-82b3-48f4dd84b7aa"}
[task 2022-09-07T00:21:04.714Z] PID 439 | 1662510064712	CDP	TRACE	CDPConnection efa2756b-15c0-4436-afce-6a17eaf1a75d <- {"method":"Target.receivedMessageFromTarget","params":{"sessionId":"3162eb7d-2d3e-484a-82b3-48f4dd84b7aa","message":"{\"method\":\"Page.frameStoppedLoading\",\"params\":{\"frameId\":\"19\"}}"}}
[task 2022-09-07T00:21:24.244Z] TEST-UNEXPECTED-TIMEOUT | Screenshots Page.screenshot should run in parallel in multiple pages (screenshot.spec.js) | expected PASS
[task 2022-09-07T00:21:24.244Z] TEST-INFO took 20263ms
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 4 years ago → 3 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 3 years ago → 3 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 3 years ago → 3 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 3 years ago → 3 years ago
Duplicate of bug: 1737372
Resolution: --- → DUPLICATE

We don't differentiate between CDP and Wd anymore in CI. As such we cannot just duplicate it. There are as well some recent failures.

Status: RESOLVED → REOPENED
No longer duplicate of bug: 1737372
Resolution: DUPLICATE → ---
Duplicate of this bug: 1888509

All the latest failures are related to our IPC related issue when running commands in the content process (see bug 1935939).

(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] from comment #32)

All the latest failures are related to our IPC related issue when running commands in the content process (see bug 1935939).

Not sure this is correct.

All the failures I've seen are stuck on a browsingContext._awaitViewportDimensions call, but there is no IPC issue, because we can see a ping being issued and successfully resolving:

MessageHandlerFrameParent command browsingContext._awaitViewportDimensions to 462 takes more than 10 seconds to resolve, sending ping
MessageHandlerFrameParent ping for command browsingContext._awaitViewportDimensions to 462 was successful

The test is also starting screenshots in parallel in many pages, which means we can very likely try to set a viewport on a background tab. And looking at the _awaitViewportDimensions implementation I think it's likely to fail in that case: https://searchfox.org/firefox-main/rev/3c52c9c886f7b0423001cef86abfafcf97f2b90a/remote/webdriver-bidi/modules/windowglobal/browsingContext.sys.mjs#459-486

async _awaitViewportDimensions(options) {
  const { height, width } = options;

  const win = this.messageHandler.window;
  let resized;

  // Updates for background tabs are throttled, and we also have to make
  // sure that the new browser dimensions have been received by the content
  // process. As such wait for the next animation frame.
  await lazy.AnimationFramePromise(win);

  const checkBrowserSize = () => {
    if (win.innerWidth === width && win.innerHeight === height) {
      resized();
    }
  };

  return new Promise(resolve => {
    resized = resolve;

    win.addEventListener("resize", checkBrowserSize);

    // Trigger a layout flush in case none happened yet.
    checkBrowserSize();
  }).finally(() => {
    win.removeEventListener("resize", checkBrowserSize);
  });
}

For info, I modified https://searchfox.org/firefox-main/rev/3c52c9c886f7b0423001cef86abfafcf97f2b90a/remote/webdriver-bidi/modules/root/browsingContext.sys.mjs#2552-2570

if (targetHeight !== currentHeight || targetWidth !== currentWidth) {
  if (!navigable.isActive) {
    // Force a synchronous update of the remote browser dimensions so that
    // background tabs get resized.
    browser.ownerDocument.synchronouslyUpdateRemoteBrowserDimensions(
      /* aIncludeInactive = */ true
    );
  }
  // Wait until the viewport has been resized
  await this._forwardToWindowGlobal(
    "_awaitViewportDimensions",
    navigable.id,
    {
      height: targetHeight,
      width: targetWidth,
    },
    { retryOnAbort: true }
  );
}

to stop checking navigable.isActive, I think there's no guarantee that the navigable will remain active until the _awaitViewportDimention command is received. That seems to fix this intermittent.

Alternatively we could use the same approach as for _awaitVisibilityState and use a timeout (which we implemented in Bug 2003857 - Wait for document to be visible in browsingContext.create with background=false)

Depends on: 2019511

hi, @whimboo, I've recently noticed that job- Linux 24.04 opt Puppeteer tests source-test-puppeteer-puppeteer 2 is frequently failling on beta-simulations (try) as you can see here, it's been frequent even before the latest merge and after, but it's not frequent on beta. Looks like it's only failing on try frequently, is this something worth investigating?

Flags: needinfo?(hskupin)

(In reply to rperta from comment #47)

hi, @whimboo, I've recently noticed that job- Linux 24.04 opt Puppeteer tests source-test-puppeteer-puppeteer 2 is frequently failling on beta-simulations (try) as you can see here, it's been frequent even before the latest merge and after, but it's not frequent on beta. Looks like it's only failing on try frequently, is this something worth investigating?

FYI, we filed Bug 2019511 to investigate what I believe to be the root cause of this. I'll try to see if I can repro on a beta simulation and will check if my patch helps.

Flags: needinfo?(hskupin)

This failure should be fixed now. Lets observe and lets close next week if no more failures occur especially for beta simulations.

Fixed by Julian on bug 2019511. There are only two failures on beta, so we don't think it's worth an uplift seeing that we merge to beta next week as well.

Assignee: nobody → jdescottes
Status: REOPENED → RESOLVED
Closed: 3 years ago → 8 months ago
No longer depends on: 1935939
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
You need to log in before you can comment on or make changes to this bug.