Skip to content

Commit

Permalink
use sending count to make sure we don't produce false positives, #178
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 18, 2023
1 parent 73fd583 commit cc68714
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions js/node-client/runTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ module.exports = async function( testInfo, options ) {
await page.authenticate( { username: process.env.BASIC_USERNAME, password: process.env.BASIC_PASSWORD } );
}

// TODO: have pendingPassFail when the result isn't sent, https://github.com/phetsims/aqua/issues/178
let receivedPassFail = false;
let gotNextTest = false;

Expand Down Expand Up @@ -139,7 +138,7 @@ module.exports = async function( testInfo, options ) {
resolveIfReady();
}
else if ( event.type === 'test-fail' ) {
receivedPassFail = false;
receivedPassFail = true;
winston.info( 'Sending FAIL result' );

currentSendingCount++;
Expand Down Expand Up @@ -197,11 +196,11 @@ module.exports = async function( testInfo, options ) {
( async () => {
await sleep( bailTimout );
if ( !gotNextTest ) {
if ( receivedPassFail ) {
if ( receivedPassFail && currentSendingCount === 0 ) {
resolve();
}
else {
reject( new Error( `Did not get next-test message in ${bailTimout}ms: ${JSON.stringify( testInfo.test )}` ) );
reject( new Error( `Did not get next-test message in ${bailTimout}ms (currentSendingCount ${currentSendingCount}): ${JSON.stringify( testInfo.test )}` ) );
}
}
} )();
Expand Down

0 comments on commit cc68714

Please sign in to comment.