Closed Bug 1345132 Opened 8 years ago Closed 8 years ago

test_claim.html is racy

Categories

(Core :: DOM: Service Workers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: bkelly, Assigned: bkelly)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

It looks like test_claim.html has a bug where it does not actually wait for the claim() promise to resolve. It does: return claimPromise.then(self.clients.matchAll().then(function(matched) { Which executes the matchAll() immediately.
Catalin, I think the promise handling in these workers is not quite right. Right now its executing that second matchAll() immediately which causes it to race with the claim().
Attachment #8844496 - Flags: review?(catalin.badea392)
Comment on attachment 8844496 [details] [diff] [review] Fix races in test_claim.html mochitest. r=catalinb Review of attachment 8844496 [details] [diff] [review]: ----------------------------------------------------------------- Yes, it's definitely wrong. Thanks for spotting this.
Attachment #8844496 - Flags: review?(catalin.badea392) → review+
Pushed by bkelly@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/a0d5e6f181da Fix races in test_claim.html mochitest. r=catalinb
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: