Closed Bug 1039748 Opened 5 years ago Closed 5 years ago

test_TelemetryPing.js should not depend on HTTP request ordering

Categories

(Toolkit :: Telemetry, defect)

x86
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: sworkman, Assigned: sworkman)

Details

Attachments

(1 file)

test_TelemetryPing.js, specifically test_saveLoadPing() currently depends on HTTP requests being sent in order, but this cannot be guaranteed in all cases.

Patches for bug 354493 change timing slightly for HTTP connection setup. In some cases, the 2nd request is able to get a DNS result before the 1st request, resulting in it being sent first:

-- 1st request initiates async DNS lookup; adds itself to callback queue.
-- DNS lookup completes on DNS thread.
-- Meanwhile, 2nd request initiates DNS lookup from socket thread; since the DNS record is now cached, DNS service responds immediately => connection for 2nd request is established.
-- Callback for 1st request is called on DNS thread; socket thread is notified and starts connection.

There are no ordering guarantees made when using AsyncOpen; so test_saveLoadPing() should be adjusted to allow for "test-ping" and "saved-session" to be received in either order.
Attachment #8457449 - Flags: review?(rvitillo)
Try run for this patch on top of patches for Bug 354493; multiple respins of xpcshell tests all passing.
https://tbpl.mozilla.org/?tree=Try&rev=0bf78ba15ab1
Comment on attachment 8457449 [details] [diff] [review]
v1.0 Remove HTTP request ordering dependency from test_TelemetryPing.js

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

Looks good, thank!
Attachment #8457449 - Flags: review?(rvitillo) → review+
https://hg.mozilla.org/mozilla-central/rev/3722ad1da723
Status: NEW → RESOLVED
Closed: 5 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
You need to log in before you can comment on or make changes to this bug.