Bug 1182516 - Add Chaos Mode environment variable MOZ_CHAOSMODE. r=roc

This commit is contained in:
Benoit Girard
2015-07-14 17:29:23 -04:00
parent 2212e22c88
commit b4e210eae2
9 changed files with 42 additions and 29 deletions

View File

@@ -236,7 +236,7 @@ TimerThread::Run()
if (mSleeping) {
// Sleep for 0.1 seconds while not firing timers.
uint32_t milliseconds = 100;
if (ChaosMode::isActive(ChaosMode::TimerScheduling)) {
if (ChaosMode::isActive(ChaosFeature::TimerScheduling)) {
milliseconds = ChaosMode::randomUint32LessThan(200);
}
waitFor = PR_MillisecondsToInterval(milliseconds);
@@ -320,7 +320,7 @@ TimerThread::Run()
// interval is so small we should not wait at all).
double microseconds = (timeout - now).ToMilliseconds() * 1000;
if (ChaosMode::isActive(ChaosMode::TimerScheduling)) {
if (ChaosMode::isActive(ChaosFeature::TimerScheduling)) {
// The mean value of sFractions must be 1 to ensure that
// the average of a long sequence of timeouts converges to the
// actual sum of their times.