Closed Bug 1271264 Opened 8 years ago Closed 8 years ago

Intermittent testAccessibleCarets | testAccessibleCarets.js - [ false === true ] There should now be paste-able text in the clipboard. - See following stack:

Categories

(Firefox for Android Graveyard :: Testing, defect)

defect
Not set
normal

Tracking

(firefox51 fixed)

RESOLVED FIXED
Firefox 51
Tracking Status
firefox51 --- fixed

People

(Reporter: cbook, Assigned: gbrown)

References

()

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

https://treeherder.mozilla.org/logviewer.html#?job_id=27491579&repo=mozilla-inbound#L3595


 05:36:13 WARNING - TEST-UNEXPECTED-FAIL | testAccessibleCarets | testAccessibleCarets.js - [ false === true ] There should now be paste-able text in the clipboard. - See following stack:
In other tests, like https://dxr.mozilla.org/mozilla-central/rev/2ea3d51ba1bb9f5c3b6921c43ea63f70b4fdf5d2/editor/libeditor/tests/test_CF_HTML_clipboard.html#47, I see hasDataMatchingFlavors() called in a polling loop; would that be appropriate here?
Flags: needinfo?(markcapella)
Yah, my last dangling thread :-/

I dug down the clipboard codepaths briefly here, and stopped with the belief we're losing an async race, and probably need a promise callback. 

Does that help? (I'm time-constrained atm, or I'd look closer).
Flags: needinfo?(markcapella)
Assignee: nobody → gbrown
This is speculative: I don't know the cause of the failure. I see other tests that either retry until hasDataMatchingFlavors() succeeds, or ensure that time passes between populating the clipboard and calling hasDataMatchingFlavors().

For this test, moving the clipboard population before loading the test page ought to provide ample opportunity for whatever we are waiting for. On try, I don't see any failures with this change: https://treeherder.mozilla.org/#/jobs?repo=try&revision=f1523639abd1 (there are existing frequent failures in testUnifiedTelemetryClientId).
Attachment #8784415 - Flags: review?(markcapella)
Comment on attachment 8784415 [details] [diff] [review]
populate clipboard earlier

Review of attachment 8784415 [details] [diff] [review]:
-----------------------------------------------------------------

Seems fragile, but it should suffice for test/support code.

on quick read ... relevant code where Clipboard background task |setTask()| goes async in parallel to Gecko [0] ... the |getTask()| version seems to trick out a sync-like positive return from the background task via SynchronousQueue [1] 

Can we enhance that in a followup?

[0] https://dxr.mozilla.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/Clipboard.java#62
[1] https://dxr.mozilla.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/Clipboard.java#35
Attachment #8784415 - Flags: review?(s.kaspari)
Attachment #8784415 - Flags: review?(markcapella)
Attachment #8784415 - Flags: feedback+
Attachment #8784415 - Flags: review?(s.kaspari) → review+
(In reply to Mark Capella [:capella] from comment #20)
> Can we enhance that in a followup?

I will file a bug but likely won't pursue it if the test becomes stable.
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0b26c3764c4c
Populate clipboard earlier to avoid intermittent failure in testAccessibleCarets; r=sebastian
See Also: → 1298506
https://hg.mozilla.org/mozilla-central/rev/0b26c3764c4c
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: