Backed out changeset 39d74e5c3df5 (bug 1149897) for frequent bc3 timeout errors

This commit is contained in:
Wes Kocher 2015-04-02 16:12:06 -07:00
parent f5a5e14a15
commit 5a094e519c
3 changed files with 13 additions and 40 deletions

View File

@ -567,14 +567,11 @@ struct AutoStopwatch final
ULARGE_INTEGER userTimeInt;
kernelTimeInt.LowPart = kernelFileTime.dwLowDateTime;
kernelTimeInt.HighPart = kernelFileTime.dwHighDateTime;
// Convert 100 ns to 1 us, make sure that the result is monotonic
*systemTime = runtime_-> stopwatch.systemTimeFix.monotonize(kernelTimeInt.QuadPart / 10);
*systemTime = kernelTimeInt.QuadPart / 10; // 100 ns to 1 us
userTimeInt.LowPart = userFileTime.dwLowDateTime;
userTimeInt.HighPart = userFileTime.dwHighDateTime;
// Convert 100 ns to 1 us, make sure that the result is monotonic
*userTime = runtime_-> stopwatch.userTimeFix.monotonize(userTimeInt.QuadPart / 10);
*userTime = userTimeInt.QuadPart / 10; // 100 ns to 1 us
#endif // defined(XP_UNIX) || defined(XP_WIN)
return true;

View File

@ -1532,28 +1532,6 @@ struct JSRuntime : public JS::shadow::Runtime,
return isActive_;
}
// Some systems have non-monotonic clocks. While we cannot
// improve the precision, we can make sure that our measures
// are monotonic nevertheless. We do this by storing the
// result of the latest call to the clock and making sure
// that the next timestamp is greater or equal.
struct MonotonicTimeStamp {
MonotonicTimeStamp()
: latestGood_(0)
{}
inline uint64_t monotonize(uint64_t stamp)
{
if (stamp <= latestGood_)
return latestGood_;
latestGood_ = stamp;
return stamp;
}
private:
uint64_t latestGood_;
};
MonotonicTimeStamp systemTimeFix;
MonotonicTimeStamp userTimeFix;
private:
/**
* A map used to collapse compartments belonging to the same

View File

@ -93,10 +93,8 @@ function monotinicity_tester(source, testName) {
// Sanity check on components data.
let set = new Set();
let keys = [];
for (let item of snapshot.componentsData) {
let key = `{name: ${item.name}, addonId: ${item.addonId}, isSystem: ${item.isSystem}}`;
keys.push(key);
let key = `{name: ${item.name}, addonId: ${item.addonId}}`;
set.add(key);
sanityCheck(previous.componentsMap.get(key), item);
previous.componentsMap.set(key, item);
@ -105,15 +103,13 @@ function monotinicity_tester(source, testName) {
Assert_leq(item[k], snapshot.processData[k],
`Sanity check (${name}): component has a lower ${k} than process`);
}
for (let i = 0; i < item.durations.length; ++i) {
Assert_leq(item.durations[i], snapshot.processData.durations[i],
`Sanity check (${name}): component has a lower durations[${i}] than process.`);
}
}
// Check that we do not have duplicate components.
info(`Before deduplication, we had the following components: ${keys.sort().join(", ")}`);
info(`After deduplication, we have the following components: ${[...set.keys()].sort().join(", ")}`);
info(`Deactivating deduplication check (Bug 1150045)`);
if (false) {
Assert.equal(set.size, snapshot.componentsData.length);
}
Assert.equal(set.size, snapshot.componentsData.length);
});
let interval = window.setInterval(frameCheck, 300);
registerCleanupFunction(() => {
@ -137,9 +133,11 @@ add_task(function* test() {
info("Opening URL");
newTab.linkedBrowser.loadURI(URL);
info("Setting up monotonicity testing");
monotinicity_tester(() => PerformanceStats.getSnapshot(), "parent process");
monotinicity_tester(() => promiseContentResponseOrNull(browser, "compartments-test:getStatistics", null), "content process" );
info("Skipping monotonicity testing (1149897)");
if (false) {
monotinicity_tester(() => PerformanceStats.getSnapshot(), "parent process");
monotinicity_tester(() => promiseContentResponseOrNull(browser, "compartments-test:getStatistics", null), "content process" );
}
while (true) {
let stats = (yield promiseContentResponse(browser, "compartments-test:getStatistics", null));