Skip to content

Commit 1344228

Browse files
committed
Mark the bottom of the stack everytime we start a new self test.
Because longjohn was collecting frames across runs of self test in the loop, we were actually seeing frame lists that applied to more than one test. This wasn't actually causing problems except in our frame parsing tests, but you can imagine that it would be quite unhelpful.
1 parent a499c4a commit 1344228

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

tools/tests/parse-stack-test.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ selftest.define("parse-stack - parse stack traces without fibers", () => {
1212
const firstFilePath = files.convertToStandardPath(parsedStack[0].file);
1313
selftest.expectEqual(_.last(firstFilePath.split("/")), "parse-stack-test.js");
1414

15-
// This is no longer true as longjohn adds a bunch of pre-app frames to the
16-
// call stack. However it doesn't seem we actually rely on this behavior
17-
// anywhere
18-
// const lastFilePath = files.convertToStandardPath(_.last(parsedStack).file);
19-
// selftest.expectEqual(_.last(lastFilePath.split("/")), "main.js");
15+
const lastFilePath = files.convertToStandardPath(_.last(parsedStack).file);
16+
selftest.expectEqual(_.last(lastFilePath.split("/")), "selftest.js");
2017

2118
markBottom(() => {
2219
const markedErr = new Error();

tools/tool-testing/selftest.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,10 @@ var runTests = function (options) {
18511851
try {
18521852
runningTest = test;
18531853
var startTime = +(new Date);
1854-
test.f(options);
1854+
// ensure we mark the bottom of the stack each time we start a new test
1855+
parseStack.markBottom(() => {
1856+
test.f(options);
1857+
})();
18551858
} catch (e) {
18561859
failure = e;
18571860
} finally {

0 commit comments

Comments
 (0)