Commit 43bd746d authored by Johannes Henkel's avatar Johannes Henkel Committed by Commit Bot

[DevTools] Make test not flake on MacOS 10.10.

I've been seeing a revert due to this test being flaky.
Root cause appears to be that sometimes, the Window's node
name is just "Window", and sometimes it's "Window / file://".
So I'm thinking this can be cured by making it always Window.

Change-Id: I89e57f248d24462fdcb79e6db4e278e58f93c473
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1546939Reviewed-by: default avatarAlexei Filippov <alph@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646454}
parent a609bd90
......@@ -4,10 +4,10 @@ Parsed snapshot
SUCCESS: found leaking
path1 = [(Global handles),(GC roots),]
path2 = [(Global handles),(GC roots),]
path3 = [V8EventListener,EventListener,InternalNode,InternalNode,HTMLBodyElement,HTMLHtmlElement,HTMLDocument,Window / file://]
path3 = [V8EventListener,EventListener,InternalNode,InternalNode,HTMLBodyElement,HTMLHtmlElement,HTMLDocument,Window]
SUCCESS: found a single retaining path for V8EventListener.
SUCCESS: V8EventListener has an immediate retainer of EventListener.
path4 = [V8EventListener,EventListener,InternalNode,InternalNode,HTMLDivElement,HTMLBodyElement,HTMLHtmlElement,HTMLDocument,Window / file://]
path4 = [V8EventListener,EventListener,InternalNode,InternalNode,HTMLDivElement,HTMLBodyElement,HTMLHtmlElement,HTMLDocument,Window]
SUCCESS: found a single retaining path for V8EventListener.
SUCCESS: V8EventListener has an immediate retainer of EventListener.
SUCCESS: found 2 V8EventListeners as retainers.
......
......@@ -40,7 +40,19 @@
}
// Sort alphabetically to make the test robust.
function toNames(path) {
return path.map(node => node.name().includes('::') ? 'InternalNode' : node.name());
let names = [];
for (node of path) {
if (node.name().includes('::')) {
names.push('InternalNode');
} else if (node.name() == 'Window / file://') {
// In MacOS 10.10 it's sometimes just Window, so we always make it
// so to avoid flakiness.
names.push('Window');
} else {
names.push(node.name());
}
}
return names;
}
retainerPaths.sort((path1, path2) => {
let s1 = toNames(path1).join('->');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment