Skip to content

Commit

Permalink
Decrease VxSuite test flakiness (#4407)
Browse files Browse the repository at this point in the history
* Bump timeouts for long-running tests

* Decrease parallelization of VxScan backend tests in CI

* Account for Live Check edge case
  • Loading branch information
arsalansufi authored Dec 13, 2023
1 parent 975beaa commit c126a3b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/mark-scan/frontend/src/app_end_to_end.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ afterEach(() => {
apiMock.mockApiClient.assertComplete();
});

jest.setTimeout(40_000);
jest.setTimeout(60_000);

test('MarkAndPrint end-to-end flow', async () => {
const logger = fakeLogger();
Expand Down
2 changes: 1 addition & 1 deletion apps/mark/frontend/src/app_end_to_end.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ afterEach(() => {
apiMock.mockApiClient.assertComplete();
});

jest.setTimeout(30000);
jest.setTimeout(60_000);

test('MarkAndPrint end-to-end flow', async () => {
const logger = fakeLogger();
Expand Down
2 changes: 1 addition & 1 deletion apps/scan/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"pre-commit": "lint-staged",
"start": "node ./build/index.js",
"test": "is-ci test:ci test:watch",
"test:ci": "jest --coverage --reporters=default --reporters=jest-junit --maxWorkers=6",
"test:ci": "jest --coverage --reporters=default --reporters=jest-junit --maxWorkers=2 # VxScan backend tests (which involve lots of polling and I/O operations) get flaky when we set --maxWorkers higher",
"test:coverage": "jest --coverage",
"test:debug": "node --inspect-brk $(which jest) --runInBand --no-cache",
"test:watch": "jest --watch",
Expand Down
2 changes: 1 addition & 1 deletion apps/scan/backend/src/app_usb_drive.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ test('doesUsbDriveRequireCastVoteRecordSync is properly populated', async () =>
});
}
);
});
}, 30_000);
8 changes: 7 additions & 1 deletion libs/auth/src/live_check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ test.each<{
machineId,
electionHash: isMachineConfiguredForAnElection ? electionHash : undefined,
});
expect(qrCodeValue).toHaveLength(expectedQrCodeValueLength);
expect([
expectedQrCodeValueLength,
// There's a slight chance that the base64-encoded signature within the QR code value is 92
// characters long instead of 96. (The length of a base64-encoded string is always a multiple
// of 4.)
expectedQrCodeValueLength - 4,
]).toContain(qrCodeValue.length);
}
);
2 changes: 1 addition & 1 deletion libs/backend/src/cast_vote_records/export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
readCastVoteRecord,
} from './test_utils';

jest.setTimeout(10_000);
jest.setTimeout(30_000);

const mockFeatureFlagger = getFeatureFlagMock();

Expand Down

0 comments on commit c126a3b

Please sign in to comment.