Closed Bug 2026458 Opened 8 months ago Closed 8 months ago

Frequent win <test> | load failed: timed out waiting for pending paint count to reach zero (waiting for MozAfterPaint) | single tracking bug

Categories

(Core :: Layout, defect, P5)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox-esr140 --- unaffected
firefox149 --- unaffected
firefox150 --- fixed
firefox151 --- fixed

People

(Reporter: intermittent-bug-filer, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: intermittent-failure, intermittent-testcase, regression, Whiteboard: [collect_confirm_failure])

Summary: Frequent <test> | load failed: timed out waiting for pending paint count to reach zero (waiting for MozAfterPaint) | single tracking bug → Frequent win beta <test> | load failed: timed out waiting for pending paint count to reach zero (waiting for MozAfterPaint) | single tracking bug

Not sure what's going on yet, but I did chase it back in time a bit with some retrigger-spamming. Oldest instance so far:
https://treeherder.mozilla.org/logviewer?job_id=555738337&repo=mozilla-beta&task=O_scTAFLTyK-8P6ubMDzgA.0&lineNumber=5305

I queued up some retriggers on builds before that; let's see if any of them hit the issue....

It's possible this goes back to the 150 nightly-->beta merge on Monday, which was this push:
https://treeherder.mozilla.org/jobs?repo=mozilla-beta&group_state=expanded&selectedTaskRun=YdNTEpcmTDmVzsJBuhz-6w.0&resultStatus=success%2Ctestfailed%2Cbusted%2Cexception&searchStr=win%2Creftest&revision=6f350780874c5fde15585ff46d04bead50f4cbe8

Regarding what this "timed out waiting for pending paint count to reach zero (waiting for MozAfterPaint)" message means -- I'm not entirely sure, but I think it means the harness believes that Firefox has something to repaint (and we're waiting on that paint to let things stabilize before taking our reftest snapshot); and then a repaint never comes; and so we wait forever and time out.

The specific log message comes from here, if it ends up being useful as we chase this down:
https://searchfox.org/firefox-main/rev/9233846aa396b6974783199e1bfe3a38473fc518/layout/tools/reftest/reftest-content.js#803-804,806

(In reply to Daniel Holbert [:dholbert] from comment #2)

Regarding what this "timed out waiting for pending paint count to reach zero (waiting for MozAfterPaint)" message means -- I'm not entirely sure, but I think it means the harness believes that Firefox has something to repaint (and we're waiting on that paint to let things stabilize before taking our reftest snapshot); and then a repaint never comes; and so we wait forever and time out.

The specific log message comes from here, if it ends up being useful as we chase this down:
https://searchfox.org/firefox-main/rev/9233846aa396b6974783199e1bfe3a38473fc518/layout/tools/reftest/reftest-content.js#803-804,806

Yes, exactly right. It means that

https://searchfox.org/firefox-main/rev/9233846aa396b6974783199e1bfe3a38473fc518/layout/tools/reftest/reftest-content.js#375

isMozAfterPaintPending returned true but no MozAfterPaint was sent. This calls this function

https://searchfox.org/firefox-main/rev/9233846aa396b6974783199e1bfe3a38473fc518/layout/base/nsPresContext.cpp#127

Finding out what changeset caused this might be the best way to track this down, even if that involves bisecting commits.

(In reply to Daniel Holbert [:dholbert] from comment #2)

It's possible this goes back to the 150 nightly-->beta merge on Monday, which was this push:
https://treeherder.mozilla.org/jobs?repo=mozilla-beta&group_state=expanded&selectedTaskRun=YdNTEpcmTDmVzsJBuhz-6w.0&resultStatus=success%2Ctestfailed%2Cbusted%2Cexception&searchStr=win%2Creftest&revision=6f350780874c5fde15585ff46d04bead50f4cbe8

My retriggers did turn up some test-failures on that push, e.g. this one:
https://treeherder.mozilla.org/logviewer?job_id=555743107&repo=mozilla-beta&task=JTNzOyU3Sly4F8L-sOSIcw.0&lineNumber=16762

That likely means that the regressor could be anything from the 150 Nightly cycle (though this only shows up on builds that use the beta configuration/branding). :-/

I queued up a bunch of retriggers from the previous push to be sure - those should show up here within an hour or so:
https://treeherder.mozilla.org/jobs?repo=mozilla-beta&group_state=expanded&selectedTaskRun=Aw3ioH0uTW-wcOKkoBcfLw.0&resultStatus=success%2Ctestfailed%2Cbusted%2Cexception&searchStr=win%2Creftest&revision=3a313ed4238121f73e8ecd07d7fea2273bab7810

Summary: Frequent win beta <test> | load failed: timed out waiting for pending paint count to reach zero (waiting for MozAfterPaint) | single tracking bug → Frequent win <test> | load failed: timed out waiting for pending paint count to reach zero (waiting for MozAfterPaint) | single tracking bug

(In reply to Atila Butkovits from comment #6)

It also started to fail on central and autoland

That's sorta-good news; that might make it easier to bisect.

(As of now, it does look like beta-before-the-150-merge (final link in comment 4) is unaffected. So on beta, this was introduced by the massive merge-from-central commit.)

Flags: needinfo?(dholbert)

I queued up ~20 Windows 11 24H2 Shippable "R2" tasks on each of these mozilla-central pushes from the past week to hopefully get an idea for a regression range there. (Presumably it's something that landed recently before the merge-to-beta, shortly before Monday Mar 23.)

Tues Mar 24
Mon Mar 23
Sat Mar 21
Tues Mar 17

Looks like this is currently narrowed down between
a good push on Mar 19
a bad push on Mar 21

Retriggers pending between that.

Potentially it seems like this push:

https://hg-edge.mozilla.org/mozilla-central/pushloghtml?changeset=2b20bfa2ea0f76fc657a1326427cc632f24eeda1

Bug 2024195 - Migrate reftest Windows tasks to win11-64-25h2 worker pools r=releng-reviewers,ahal
jumps out from that list

Jonathan, could you please have a look into these frequent sometimes perma reftest failures?

Flags: needinfo?(jmoss)

So probably this is something going wrong (whether in Firefox or externally) in the win11-64-25h2-gpu test runners.

Given how substantial the intermittent failures are here, it seems like we should backout bug 2024195 (or at least the reftest-impacting portion of it) and then sort it out before re-landing.

One clue... Reftest logs from after the change (like this one) have lots of instances of warnings like this:

WARNING - REFTEST WARNING | g.windowUtils.isWindowFullyOccluded true
WARNING - REFTEST WARNING | g.windowUtils.isCompositorPaused true

(These are present in bad R2 logs as well as good ones from the same push; though they might be more frequent in the bad logs)

...whereas logs before the change (like this one) have zero mentions of those warnings.

So maybe something about the new test-runner-configuration has Firefox windows being occluded in some way? (Maybe some Windows onboarding UI or some other window has appeared and is blocking Firefox?)

(In reply to Daniel Holbert [:dholbert] from comment #12)

One clue... Reftest logs from after the change (like this one) have lots of instances of warnings like this:

WARNING - REFTEST WARNING | g.windowUtils.isWindowFullyOccluded true
WARNING - REFTEST WARNING | g.windowUtils.` true

(These are present in bad R2 logs as well as good ones from the same push; though they might be more frequent in the bad logs)

Hmm, those aren't universally present in good-logs-after-the-change, actually; here's an "good" R2 log from an intermittently-bad push, and the log doesn't mention isWindowFullyOccluded at all:
https://treeherder.mozilla.org/logviewer?job_id=555971621&repo=mozilla-central&task=fzlvat_4Q2OHCkpRrLNoHA.0

All of the "bad" logs from that push do have these warnings about isWindowFullyOccluded and isCompositorPaused, though. So, working theory: this occluding (from another program/window?) only intermittently happens -- but when it does happen, it's likely to cause this sort of test-failure.

jmoss or ahal, do you know if it's possible to get a screen-capture of the actual desktop, or a screen recording, from one of these "bad" logs? (after the issue has happened) I know sometimes that's included as a .png link in the parsed log (e.g. for mochitest runs) but I don't see that included in these reftest logs.

Flags: needinfo?(ahal)

(In reply to Daniel Holbert [:dholbert] from comment #12)

One clue... Reftest logs from after the change (like this one) have lots of instances of warnings like this:

WARNING - REFTEST WARNING | g.windowUtils.isWindowFullyOccluded true
WARNING - REFTEST WARNING | g.windowUtils.isCompositorPaused true

Good find! Yes, this should ideally be an error and turn reftests orange. We need to fix this.

The builtin timeout of the reftest harness prevents tasks from hitting the more general timeout and grabbing a screenshot, but the reftest harness timeout can be increased past that if getting a screenshot would be helpful.

Try push with reftest internal timeout set to 60 mins, hopefully this generates a screenshot

https://treeherder.mozilla.org/jobs?repo=try&group_state=expanded&revision=b08e85c3ba5c87a744e454a892c2dab8a4036978

My autoland retriggers/new tasks have pretty much pointed at bug 2024195.

Keywords: regression
Regressed by: 2024195

Set release status flags based on info from the regressing bug 2024195

I was able to make a test timeout and not hit the reftest timeout, but no screenshot was triggered unfortunately
https://treeherder.mozilla.org/jobs?repo=try&group_state=expanded&revision=b9be515a9d75e64d714bfdbf809f57a23167f620

Duplicate of this bug: 2026950

:dholbert I have a patch in place that could fix this, but not sure if it's a bandaid or not: https://treeherder.mozilla.org/jobs?repo=try&revision=0728266b08c2f7657ac71f9b5eca99a3e7fa0705. I am also unsure of how to add a screenshot or video to the task, although I do know that like you mentioned mochitests runs include this.

Flags: needinfo?(tnikkel)
Flags: needinfo?(jmoss)
Flags: needinfo?(dholbert)

(In reply to :jmoss from comment #22)

:dholbert I have a patch in place that could fix this, but not sure if it's a bandaid or not: https://treeherder.mozilla.org/jobs?repo=try&revision=0728266b08c2f7657ac71f9b5eca99a3e7fa0705.

Thanks - that's toggling widget.windows.window_occlusion_tracking.enabled to false, and it does look like that avoids the problem.

That does feel like a bit of a hackaround, though... That feature is enabled by default for our users, so we probably don't want to be switching it off for a whole test suite. (Hypothetically if we introduce a regression at some point where we mistakenly think we're occluded and we stop painting, then users would hit real problems, whereas our reftest suite [with this pref now flipped] would fail to notify us about it.)

For now I think I'd still favor a backout the regressor patch, rather than landing that band-aid; and we should figure out what is blocking our window (and then adjust the test harness or image to address/avoid that) before re-landing the regressor patch.

I am also unsure of how to add a screenshot or video to the task, although I do know that like you mentioned mochitests runs include this.

For mochitests at least, it looks like we use --screenshot-on-fail to get this behavior (but unfortunately the equivalent harness code doesn't recognize that option for reftests). Not sure if this will work, but I kicked off a TryServer run with mochitests on the new Windows platform (just copypasting the worker-type code to over to the mochitest-plain section of the taskcluster kind.yml file), and maybe/hopefully retriggers there will hit a version of the same issue, and we can see what window(s) are visible...

Flags: needinfo?(dholbert)

(In reply to Daniel Holbert [:dholbert] from comment #23)

(In reply to :jmoss from comment #22)

:dholbert I have a patch in place that could fix this, but not sure if it's a bandaid or not: https://treeherder.mozilla.org/jobs?repo=try&revision=0728266b08c2f7657ac71f9b5eca99a3e7fa0705.

Thanks - that's toggling widget.windows.window_occlusion_tracking.enabled to false, and it does look like that avoids the problem.

That does feel like a bit of a hackaround, though... That feature is enabled by default for our users, so we probably don't want to be switching it off for a whole test suite. (Hypothetically if we introduce a regression at some point where we mistakenly think we're occluded and we stop painting, then users would hit real problems, whereas our reftest suite [with this pref now flipped] would fail to notify us about it.)

For now I think I'd still favor a backout the regressor patch, rather than landing that band-aid; and we should figure out what is blocking our window (and then adjust the test harness or image to address/avoid that) before re-landing the regressor patch.

I am also unsure of how to add a screenshot or video to the task, although I do know that like you mentioned mochitests runs include this.

For mochitests at least, it looks like we use --screenshot-on-fail to get this behavior (but unfortunately the equivalent harness code doesn't recognize that option for reftests). Not sure if this will work, but I kicked off a TryServer run with mochitests on the new Windows platform (just copypasting the worker-type code to over to the mochitest-plain section of the taskcluster kind.yml file), and maybe/hopefully retriggers there will hit a version of the same issue, and we can see what window(s) are visible...

I tried to hack together a method for capturing the screenshot in this try push (which didn't seem to work) but I noticed that the test is passing on try.

Flags: needinfo?(dholbert)

(In reply to :jmoss from comment #24)

I tried to hack together a method for capturing the screenshot

Nice!

in this try push (which didn't seem to work) but I noticed that the test is passing on try.

It's mostly but not always passing; we hit some instances of this failure there too, e.g. this one:
https://treeherder.mozilla.org/logviewer?job_id=556144070&repo=try&task=Dbtv2-37R6GozIm2BrhGaA.0&lineNumber=11705

I see your patch was trying to add some logging with SCREENSHOT_REQUESTED but I don't see that (or any desktop screenshots) in the log, so the patch's functionality might not quite be getting activated right now for whatever reason.

Flags: needinfo?(dholbert)

(In reply to Daniel Holbert [:dholbert] from comment #23)

(In reply to :jmoss from comment #22)

:dholbert I have a patch in place that could fix this, but not sure if it's a bandaid or not: https://treeherder.mozilla.org/jobs?repo=try&revision=0728266b08c2f7657ac71f9b5eca99a3e7fa0705.

Thanks - that's toggling widget.windows.window_occlusion_tracking.enabled to false, and it does look like that avoids the problem.

That does feel like a bit of a hackaround, though... That feature is enabled by default for our users, so we probably don't want to be switching it off for a whole test suite. (Hypothetically if we introduce a regression at some point where we mistakenly think we're occluded and we stop painting, then users would hit real problems, whereas our reftest suite [with this pref now flipped] would fail to notify us about it.)

For now I think I'd still favor a backout the regressor patch, rather than landing that band-aid; and we should figure out what is blocking our window (and then adjust the test harness or image to address/avoid that) before re-landing the regressor patch.

I would agree. We spent a lot of time making sure that windows were not occluded, we don't want to regress that. I'm planning to turn this occluded warning into an error to prevent this from happening in the future.

Blocks: 2020444

I have no problems with reverting this patch, although we'll want to address this before September 2026 since Microsoft is deprecating the sku that gecko-t/win11-64-24h2-gpu is currently using. Is this an issue with Windows 11 25H2 or the sku that runs gecko-t/win11-64-25h2-gpu using an updated gpu/driver combination?

Blocks: 2017315
See Also: → 2027171

(In reply to :jmoss from comment #27)

I have no problems with reverting this patch

Thanks!

although we'll want to address this before September 2026 since Microsoft is deprecating the sku

Roger.

Is this an issue with Windows 11 25H2 or the sku that runs gecko-t/win11-64-25h2-gpu using an updated gpu/driver combination?

I don't think we can answer that question yet.

Personally I'm still favoring the simplest (in my mind) theory, which is that we're just legitimately being occluded by some sporadically-appearing window (maybe even some Windows onboarding UI?). Getting a desktop screenshot at failure-time would get us a lot of the way to confirming/refuting that theory and understanding what's going wrong & what we can do about it...

Given that we're on the same page that reverting bug 2024195 is worth doing in the short-term, I'm going to ask sheriffs to do that (and reopen the regressing bug), and then we'll stem the flood of orange here (~500 failures in the past week, don't want that rate to continue -- though I guess that count is artificially high since those are mostly from our retriggers. :) )

Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 8 months ago → 8 months ago
Resolution: --- → FIXED
Assignee: nobody → imoraru
Assignee: imoraru → nobody

Sorry for the late reply, but unfortunately I don't recall. I want to say that reftest also had a screenshot feature, but I may have just been thinking about mochitest.

Flags: needinfo?(ahal)

Reftests have their own built in timeout mechanism that move the test suite forward if a test times out. If you made that timeout longer than the generic test suite timeout mechanism that triggered a screenshot then you used to be able to get a screenshot, but it appears that as some point recently it stopped working.

Flags: needinfo?(tnikkel)
See Also: → 2032385
See Also: → 2037651
See Also: → 2037936
See Also: → 2038455
You need to log in before you can comment on or make changes to this bug.