Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Sep 15, 2024
1 parent 8118981 commit ec1e391
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/nice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ import Piscina from '..';
import { resolve } from 'path';
import { test } from 'tap';

test('can set niceness for threads on Linux', {
skip: process.platform !== 'linux'
}, async ({ equal }) => {
test('can set niceness for threads on Linux', async ({ equal }) => {
const worker = new Piscina({
filename: resolve(__dirname, 'fixtures/eval.js'),
niceIncrement: 5
});

const currentNiceness = (await import('@napi-rs/nice')).nice(0);
const result = await worker.runTask('require("@napi-rs/nice").nice()');
const result = await worker.runTask('require("@napi-rs/nice").nice(0)');

// niceness is capped to 19 on Linux.
const expected = Math.min(currentNiceness + 5, 19);
Expand Down

0 comments on commit ec1e391

Please sign in to comment.