playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[BUG] After update to 1.32.2 fetchStart for navtiming on firefox is wrong

Open Smrtnyk opened this issue 1 year ago • 6 comments

System info

  • Playwright Version: 1.32.2
  • Operating System: Windows
  • Browser: Firefox

Source code

  • [x] I provided exact source code that allows reproducing the issue locally.

Link to the GitHub repository with the repro

[https://github.com/Smrtnyk/fetch-start-pw-repro]

Steps

  • Clone the repo
  • Run npm test

Expected

Test should not fail.

Actual

After update to 1.32.2 from 1.25.2 this test started failing all the time. fetchStart from resource timings is always negative. If you revert to playwright version 1.25.2 it succeeds. Happens only on firefox in playwright, webkit and chromium are fine. Doesn't happen on real firefox.

Smrtnyk avatar Mar 09 '23 15:03 Smrtnyk

I can reproduce on our Firefox Beta 110 and not on the official Firefox.

Looks like it has to do with how we navigate, if I do this instead, it works:

    await page.evaluate(() => window.location.reload())
    await page.waitForTimeout(1000);

mxschmitt avatar Mar 09 '23 16:03 mxschmitt

today I noticed negative values also for other fields in one of our tests, but rarely fetchStart is the one that is happening almost all the time

Error: Error during validation of Gen3Events: 22 Error(s) during validation of Gen3Events: 

[2023-03-23T19:39:51.044Z]      - $.data.events[0].connect_start: must have a minimum value of 0

[2023-03-23T19:39:51.044Z]      - $.data.events[0].request_start: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field redirect_start

[2023-03-23T19:39:51.044Z]      - $.data.events[0].connect_end: must have a minimum value of 0

[2023-03-23T19:39:51.044Z]      - $.data.events[0].connect_end: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field worker_start

[2023-03-23T19:39:51.044Z]      - $.data.events[0].domain_lookup_end: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field worker_start

[2023-03-23T19:39:51.044Z]      - $.data.events[0].connect_start: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field redirect_end

[2023-03-23T19:39:51.044Z]      - $.data.events[0].request_start: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field worker_start

[2023-03-23T19:39:51.044Z]      - $.data.events[0].connect_end: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field secure_connection_start

[2023-03-23T19:39:51.044Z]      - $.data.events[0].connect_end: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field redirect_end

[2023-03-23T19:39:51.044Z]      - $.data.events[0].domain_lookup_start: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field worker_start

[2023-03-23T19:39:51.044Z]      - $.data.events[0].connect_end: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field redirect_start

[2023-03-23T19:39:51.044Z]      - $.data.events[0].request_start: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field secure_connection_start

[2023-03-23T19:39:51.044Z]      - $.data.events[0].connect_start: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field worker_start

[2023-03-23T19:39:51.044Z]      - $.data.events[0].request_start: must have a minimum value of 0

[2023-03-23T19:39:51.044Z]      - $.data.events[0].domain_lookup_end: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field redirect_start

[2023-03-23T19:39:51.044Z]      - $.data.events[0].domain_lookup_end: must have a minimum value of 0

[2023-03-23T19:39:51.044Z]      - $.data.events[0].domain_lookup_start: must have a minimum value of 0

[2023-03-23T19:39:51.044Z]      - $.data.events[0].domain_lookup_start: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field redirect_end

[2023-03-23T19:39:51.044Z]      - $.data.events[0].request_start: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field redirect_end

[2023-03-23T19:39:51.044Z]      - $.data.events[0].domain_lookup_start: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field redirect_start

[2023-03-23T19:39:51.044Z]      - $.data.events[0].domain_lookup_end: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field redirect_end

[2023-03-23T19:39:51.044Z]      - $.data.events[0].connect_start: The current value -1 is not greater than or equal to the referenced value 0 of the referenced field redirect_start 

negative values are off the spec, they should be at least 0

Smrtnyk avatar Mar 23 '23 19:03 Smrtnyk

another thing I noticed, but should be taken with grain of salt It seems like it never happens in headed mode, just in headless I didn't run tests hundreds of times to completely confirm that but when I was debugging tests locally in headed mode it didn't happen

Smrtnyk avatar May 11 '23 11:05 Smrtnyk

@Smrtnyk your last comments suggests that this is an upstream bug in Firefox! Maybe you can build a repro without Playwright and file upstream to them?

aslushnikov avatar May 11 '23 15:05 aslushnikov

I couldn't repro this with real firefox, just in playwright and it didn't happen on playwright 1.25 version

Smrtnyk avatar May 11 '23 16:05 Smrtnyk

seems like Max says the same https://github.com/microsoft/playwright/issues/21532#issuecomment-1462379140

Smrtnyk avatar May 11 '23 16:05 Smrtnyk

Turns out this is an upstream bug.

Closing this in favor of upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1843850

aslushnikov avatar Jul 17 '23 12:07 aslushnikov