зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1703634 - Disable test_trr_cancel.js::cancel_immediately for socket process r=necko-reviewers,kershaw
The test is racy in that it expects the request to be immediately cancelled, but with the socket process that takes an IPC round-trip. Differential Revision: https://phabricator.services.mozilla.com/D136610
This commit is contained in:
Родитель
dabf47a8db
Коммит
51db0fdc6c
|
@ -45,39 +45,44 @@ add_task(async function sanity_check() {
|
||||||
await new TRRDNSListener("example.com", { expectedAnswer: "1.2.3.4" });
|
await new TRRDNSListener("example.com", { expectedAnswer: "1.2.3.4" });
|
||||||
});
|
});
|
||||||
|
|
||||||
add_task(async function cancel_immediately() {
|
// Cancelling the request is not sync when using the socket process, so
|
||||||
await trrServer.registerDoHAnswers("example.org", "A", {
|
// we skip this test when it's enabled.
|
||||||
answers: [
|
add_task(
|
||||||
{
|
{ skip_if: () => mozinfo.socketprocess_networking },
|
||||||
name: "example.org",
|
async function cancel_immediately() {
|
||||||
ttl: 55,
|
await trrServer.registerDoHAnswers("example.org", "A", {
|
||||||
type: "A",
|
answers: [
|
||||||
flush: false,
|
{
|
||||||
data: "2.3.4.5",
|
name: "example.org",
|
||||||
},
|
ttl: 55,
|
||||||
],
|
type: "A",
|
||||||
});
|
flush: false,
|
||||||
let r1 = new TRRDNSListener("example.org", { expectedSuccess: false });
|
data: "2.3.4.5",
|
||||||
let r2 = new TRRDNSListener("example.org", { expectedAnswer: "2.3.4.5" });
|
},
|
||||||
r1.cancel();
|
],
|
||||||
let { inStatus } = await r1;
|
});
|
||||||
equal(inStatus, Cr.NS_ERROR_ABORT);
|
let r1 = new TRRDNSListener("example.org", { expectedSuccess: false });
|
||||||
await r2;
|
let r2 = new TRRDNSListener("example.org", { expectedAnswer: "2.3.4.5" });
|
||||||
equal(await trrServer.requestCount("example.org", "A"), 1);
|
r1.cancel();
|
||||||
|
let { inStatus } = await r1;
|
||||||
|
equal(inStatus, Cr.NS_ERROR_ABORT);
|
||||||
|
await r2;
|
||||||
|
equal(await trrServer.requestCount("example.org", "A"), 1);
|
||||||
|
|
||||||
// Now we cancel both of them
|
// Now we cancel both of them
|
||||||
dns.clearCache(true);
|
dns.clearCache(true);
|
||||||
r1 = new TRRDNSListener("example.org", { expectedSuccess: false });
|
r1 = new TRRDNSListener("example.org", { expectedSuccess: false });
|
||||||
r2 = new TRRDNSListener("example.org", { expectedSuccess: false });
|
r2 = new TRRDNSListener("example.org", { expectedSuccess: false });
|
||||||
r1.cancel();
|
r1.cancel();
|
||||||
r2.cancel();
|
r2.cancel();
|
||||||
({ inStatus } = await r1);
|
({ inStatus } = await r1);
|
||||||
equal(inStatus, Cr.NS_ERROR_ABORT);
|
equal(inStatus, Cr.NS_ERROR_ABORT);
|
||||||
({ inStatus } = await r2);
|
({ inStatus } = await r2);
|
||||||
equal(inStatus, Cr.NS_ERROR_ABORT);
|
equal(inStatus, Cr.NS_ERROR_ABORT);
|
||||||
await new Promise(resolve => do_timeout(50, resolve));
|
await new Promise(resolve => do_timeout(50, resolve));
|
||||||
equal(await trrServer.requestCount("example.org", "A"), 2);
|
equal(await trrServer.requestCount("example.org", "A"), 2);
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
add_task(async function cancel_delayed() {
|
add_task(async function cancel_delayed() {
|
||||||
dns.clearCache(true);
|
dns.clearCache(true);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче