Bug 1760121 - Fix test_trr.js racing get-ttl with dns.clearCache r=necko-reviewers,kershaw

The test is only intermittent on windows, because the get-ttl
pref makes the record be refreshed which races clearing the DNS
cache. That means that when expecting a TRR IP we may actually get
it from the native lookup refreshing to get the TTL.

Differential Revision: https://phabricator.services.mozilla.com/D194047
This commit is contained in:
Valentin Gosu 2023-11-20 13:19:15 +00:00
Родитель 93ddafaa59
Коммит f0bb3dc21f
1 изменённых файлов: 2 добавлений и 0 удалений

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

@ -7,12 +7,14 @@ const gDefaultPref = Services.prefs.getDefaultBranch("");
SetParentalControlEnabled(false);
function setup() {
Services.prefs.setBoolPref("network.dns.get-ttl", false);
h2Port = trr_test_setup();
}
setup();
registerCleanupFunction(async () => {
trr_clear_prefs();
Services.prefs.clearUserPref("network.dns.get-ttl");
});
async function waitForConfirmation(expectedResponseIP, confirmationShouldFail) {