Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: increase run time in test-worker-prof #26172

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions test/parallel/test-worker-prof.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (!common.isMainThread)
if (process.argv[2] === 'child') {
const spin = `
const start = Date.now();
while (Date.now() - start < 200);
while (Date.now() - start < 1000);
`;
new Worker(spin, { eval: true });
eval(spin);
Expand All @@ -32,10 +32,11 @@ for (const logfile of logfiles) {
const lines = fs.readFileSync(logfile, 'utf8').split('\n');
const ticks = lines.filter((line) => /^tick,/.test(line)).length;

// Test that at least 20 ticks have been recorded for both parent and child
// Test that at least 15 ticks have been recorded for both parent and child
// threads. When not tracking Worker threads, only 1 or 2 ticks would
// have been recorded.
// When running locally on x64 Linux, this number is usually at least 150
// When running locally on x64 Linux, this number is usually at least 700
// for both threads, so 15 seems like a very safe threshold.
console.log(ticks)
addaleax marked this conversation as resolved.
Show resolved Hide resolved
assert(ticks >= 15, `${ticks} >= 15`);
}