Bug 1572271 - Part 1: Force a GC during the cleanup of antitracking tests since there is not enough idle time between these tests for GCs to kick in naturally; r=baku

This prevents a whole host of OOM issues from occurring intermittently
when running these tests.

Differential Revision: https://phabricator.services.mozilla.com/D42654

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ehsan Akhgari 2019-08-22 00:32:24 +00:00
Родитель ef1c0b40d8
Коммит c5fe8bca85
4 изменённых файлов: 31 добавлений и 0 удалений

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

@ -9,6 +9,18 @@
var gFeatures = undefined;
/**
* Force garbage collection.
*/
function forceGC() {
SpecialPowers.gc();
SpecialPowers.forceShrinkingGC();
SpecialPowers.forceCC();
SpecialPowers.gc();
SpecialPowers.forceShrinkingGC();
SpecialPowers.forceCC();
}
this.AntiTracking = {
runTestInNormalAndPrivateMode(
name,
@ -605,6 +617,10 @@ this.AntiTracking = {
if (cleanupFunction) {
await cleanupFunction();
}
// While running these tests we typically do not have enough idle time to do
// GC reliably, so force it here.
forceGC();
});
},

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

@ -120,6 +120,11 @@ this.DynamicFPIHelper = {
if (cleanupFunction) {
await cleanupFunction();
}
// While running these tests we typically do not have enough idle time to do
// GC reliably, so force it here.
/* import-globals-from antitracking_head.js */
forceGC();
});
},
};

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

@ -335,6 +335,11 @@ this.PartitionedStorageHelper = {
if (cleanupFunction) {
await cleanupFunction();
}
// While running these tests we typically do not have enough idle time to do
// GC reliably, so force it here.
/* import-globals-from antitracking_head.js */
forceGC();
});
},
};

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

@ -123,6 +123,11 @@ this.StoragePrincipalHelper = {
await cleanupFunction();
}
UrlClassifierTestUtils.cleanupTestTrackers();
// While running these tests we typically do not have enough idle time to do
// GC reliably, so force it here.
/* import-globals-from antitracking_head.js */
forceGC();
});
},
};