Skip to content

Commit

Permalink
fix flakiness of auth.test.js (nodejs#51)
Browse files Browse the repository at this point in the history
Extends the timeout from `1000` to `1500`
  • Loading branch information
priyank-p authored and joyeecheung committed Nov 2, 2017
1 parent 131266c commit 5bea81c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/unit/auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let testCounter = 0; // for tmp directories

describe('auth', async function() {
it('asks for auth data if no ncurc is found', async function() {
this.timeout(1000);
this.timeout(1500);
await runAuthScript(undefined, [
'Reading configuration for node-core-utils failed:',
/ENOENT: no such file or directory, open/,
Expand All @@ -24,7 +24,7 @@ describe('auth', async function() {
});

it('asks for auth data if ncurc is invalid json', async function() {
this.timeout(1000);
this.timeout(1500);
await runAuthScript('this is not json', [
'Reading configuration for node-core-utils failed:',
/Unexpected token h in JSON at position 1/,
Expand All @@ -37,7 +37,7 @@ describe('auth', async function() {
});

it('returns ncurc data if it is present and valid', async function() {
this.timeout(1000);
this.timeout(1500);
await runAuthScript({ username: 'nyancat', token: '0123456789abcdef' }, [
'bnlhbmNhdDowMTIzNDU2Nzg5YWJjZGVm'
]);
Expand All @@ -61,7 +61,7 @@ function runAuthScript(ncurc = undefined, expect = []) {

const proc = spawn(process.execPath,
[ require.resolve('../fixtures/run-auth') ],
{ timeout: 1000, env: Object.assign({}, process.env, { HOME }) });
{ timeout: 1500, env: Object.assign({}, process.env, { HOME }) });
let stderr = '';
proc.stderr.setEncoding('utf8');
proc.stderr.on('data', (chunk) => { stderr += chunk; });
Expand Down

0 comments on commit 5bea81c

Please sign in to comment.