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:
Valentin Gosu 2022-01-21 13:45:08 +00:00
Родитель dabf47a8db
Коммит 51db0fdc6c
1 изменённых файлов: 37 добавлений и 32 удалений

Просмотреть файл

@ -45,39 +45,44 @@ add_task(async function sanity_check() {
await new TRRDNSListener("example.com", { expectedAnswer: "1.2.3.4" });
});
add_task(async function cancel_immediately() {
await trrServer.registerDoHAnswers("example.org", "A", {
answers: [
{
name: "example.org",
ttl: 55,
type: "A",
flush: false,
data: "2.3.4.5",
},
],
});
let r1 = new TRRDNSListener("example.org", { expectedSuccess: false });
let r2 = new TRRDNSListener("example.org", { expectedAnswer: "2.3.4.5" });
r1.cancel();
let { inStatus } = await r1;
equal(inStatus, Cr.NS_ERROR_ABORT);
await r2;
equal(await trrServer.requestCount("example.org", "A"), 1);
// Cancelling the request is not sync when using the socket process, so
// we skip this test when it's enabled.
add_task(
{ skip_if: () => mozinfo.socketprocess_networking },
async function cancel_immediately() {
await trrServer.registerDoHAnswers("example.org", "A", {
answers: [
{
name: "example.org",
ttl: 55,
type: "A",
flush: false,
data: "2.3.4.5",
},
],
});
let r1 = new TRRDNSListener("example.org", { expectedSuccess: false });
let r2 = new TRRDNSListener("example.org", { expectedAnswer: "2.3.4.5" });
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
dns.clearCache(true);
r1 = new TRRDNSListener("example.org", { expectedSuccess: false });
r2 = new TRRDNSListener("example.org", { expectedSuccess: false });
r1.cancel();
r2.cancel();
({ inStatus } = await r1);
equal(inStatus, Cr.NS_ERROR_ABORT);
({ inStatus } = await r2);
equal(inStatus, Cr.NS_ERROR_ABORT);
await new Promise(resolve => do_timeout(50, resolve));
equal(await trrServer.requestCount("example.org", "A"), 2);
});
// Now we cancel both of them
dns.clearCache(true);
r1 = new TRRDNSListener("example.org", { expectedSuccess: false });
r2 = new TRRDNSListener("example.org", { expectedSuccess: false });
r1.cancel();
r2.cancel();
({ inStatus } = await r1);
equal(inStatus, Cr.NS_ERROR_ABORT);
({ inStatus } = await r2);
equal(inStatus, Cr.NS_ERROR_ABORT);
await new Promise(resolve => do_timeout(50, resolve));
equal(await trrServer.requestCount("example.org", "A"), 2);
}
);
add_task(async function cancel_delayed() {
dns.clearCache(true);