Skip to content

Commit

Permalink
Bug 1550034 - avoid most failures of the browser_startup_mainthreadio…
Browse files Browse the repository at this point in the history
….js and browser_startup_content_mainthreadio.js tests. r=mconley a=test-only CLOSED TREE

This patch contains the following changes:
- upload a startup profile when there are unused mainthread I/O whitelist entries,
- avoid 'unused whitelist entry' failures in devedition beta builds (where the IOInterposer is ifdef'ed out) while keeping coverage that ensures we are able to produce valid startup profiles,
- completely disable on Windows Arm64 where the IO interposer is broken,
- mark as ignoreIfUnused the whitelist entry that caused most intermittent failures.

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

--HG--
extra : source : 742a8ae0110dc3d862a637e4348b587fe431938f
  • Loading branch information
fqueze committed May 16, 2019
1 parent 3903573 commit 2028c0d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const processes = {
{ // bug 1357205
path: "XREAppFeat:[email protected]",
condition: !WIN,
ignoreIfUnused: true,
stat: 1,
},
],
Expand Down Expand Up @@ -344,6 +345,20 @@ add_task(async function() {
}
}

if (!whitelist.length) {
continue;
}
// The I/O interposer is disabled if !RELEASE_OR_BETA, so we expect to have
// no I/O marker in that case, but it's good to keep the test running to check
// that we are still able to produce startup profiles.
is(markers.length > 0, !AppConstants.RELEASE_OR_BETA,
procName + " startup profiles should have IO markers in builds that are not RELEASE_OR_BETA");
if (!markers.length) {
// If a profile unexpectedly contains no I/O marker, avoid generating
// plenty of confusing "unused whitelist entry" failures.
continue;
}

for (let entry of whitelist) {
for (let op in entry) {
if (["path", "condition", "ignoreIfUnused", "_used"].includes(op)) {
Expand All @@ -361,6 +376,7 @@ add_task(async function() {
}
if (!("_used" in entry) && !entry.ignoreIfUnused) {
ok(false, `unused whitelist entry ${procName}: ${entry.path}`);
shouldPass = false;
}
}
}
Expand All @@ -377,7 +393,7 @@ add_task(async function() {
await OS.File.writeAtomic(profilePath,
encoder.encode(JSON.stringify(startupRecorder.data.profile)));
ok(false,
"Found some unexpected main thread I/O during child process startup; " +
"Unexpected main thread I/O behavior during child process startup; " +
"profile uploaded in " + filename);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ add_task(async function() {
const dataCol = profile.markers.schema.data;

let markersForCurrentPhase = [];
let foundIOMarkers = false;

for (let m of profile.markers.data) {
let markerName = profile.stringTable[m[nameCol]];
Expand All @@ -807,6 +808,18 @@ add_task(async function() {
filename: markerData.filename,
source: markerData.source,
stackId: stack});
foundIOMarkers = true;
}

// The I/O interposer is disabled if !RELEASE_OR_BETA, so we expect to have
// no I/O marker in that case, but it's good to keep the test running to check
// that we are still able to produce startup profiles.
is(foundIOMarkers, !AppConstants.RELEASE_OR_BETA,
"The IO interposer should be enabled in builds that are not RELEASE_OR_BETA");
if (!foundIOMarkers) {
// If a profile unexpectedly contains no I/O marker, it's better to return
// early to avoid having plenty of confusing "unused whitelist entry" failures.
return;
}
}

Expand Down Expand Up @@ -899,6 +912,7 @@ add_task(async function() {
}
if (!("_used" in entry) && !entry.ignoreIfUnused) {
ok(false, `unused whitelist entry ${phase}: ${entry.path}`);
shouldPass = false;
}
}
}
Expand All @@ -915,7 +929,7 @@ add_task(async function() {
await OS.File.writeAtomic(profilePath,
encoder.encode(JSON.stringify(startupRecorder.data.profile)));
ok(false,
"Found some unexpected main thread I/O during startup; profile uploaded in " +
"Unexpected main thread I/O behavior during startup; profile uploaded in " +
filename);
}
});
4 changes: 3 additions & 1 deletion browser/base/content/test/performance/io/browser.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[DEFAULT]
# Currently disabled on debug due to debug-only failures, see bug 1549723.
skip-if = debug || (os == "linux" && asan) # bug 1549729
# Disabled on Linux asan due to bug 1549729.
# Disabled on Windows Arm64 due to bug 1551493.
skip-if = debug || (os == "linux" && asan) || (os == "win" && processor == "aarch64")
# to avoid overhead when running the browser normally, startupRecorder.js will
# do almost nothing unless browser.startup.record is true.
# gfx.canvas.willReadFrequently.enable is just an optimization, but needs to be
Expand Down

0 comments on commit 2028c0d

Please sign in to comment.