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

fix race condition in test case leading to sporadic fails #5765

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
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
13 changes: 3 additions & 10 deletions test/unit/replication-protocol.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
RxAttachmentWriteData,
flatClone,
requestIdlePromise,
promiseSeries,
prepareQuery
} from '../../plugins/core/index.mjs';

Expand Down Expand Up @@ -1107,14 +1108,6 @@ useParallel(testContext + ' (implementation: ' + config.storage.name + ')', () =
});
describe('stability', () => {
it('do many writes while replication is running', async () => {
if (
config.storage.name === 'lokijs' ||
config.storage.name === 'denokv'
) {
// TODO this test fails in about 1/20 times in lokijs
return;
}

const writeAmount = isFastMode() ? 5 : 10;

const masterInstance = await createRxStorageInstance(0);
Expand All @@ -1138,9 +1131,9 @@ useParallel(testContext + ' (implementation: ' + config.storage.name + ')', () =
const document = getDocData();
document.passportId = 'foobar';
const docId = document.passportId;
await Promise.all(
await promiseSeries(
instances
.map(async (instance, idx) => {
.map((instance, idx) => async () => {
// insert
const docData = Object.assign({}, clone(document), {
firstName: idx === 0 ? 'master' : 'fork',
Expand Down
Loading