Skip to content

Commit

Permalink
chore: Bump DataStore join unit test time limit (#11753)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblanc committed Aug 8, 2023
1 parent 94bfc5f commit 711a761
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/datastore/__tests__/IndexedDBAdapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ let initSchema: typeof initSchemaType;
let DataStore: typeof DataStoreType;
let Predicates = PredicatesClass;

const JOIN_TIME_LIMIT = 125; // ms

describe('IndexedDBAdapter tests', () => {
async function getMutations(adapter) {
await pause(250);
Expand Down Expand Up @@ -552,7 +554,7 @@ describe('IndexedDB benchmarks', () => {

// actual time on a decent dev machine is around 15ms, compared
// to over 130ms when the optimization is disabled.
expect(time).toBeLessThan(100);
expect(time).toBeLessThan(JOIN_TIME_LIMIT);
});

test('deep joins are within time limits expected if indexes are being used using custom PK', async () => {
Expand Down Expand Up @@ -587,7 +589,7 @@ describe('IndexedDB benchmarks', () => {

// actual time on a decent dev machine is around 20ms, compared
// to over 150ms when the optimization is disabled.
expect(time).toBeLessThan(100);
expect(time).toBeLessThan(JOIN_TIME_LIMIT);
});

test('wide joins operate within expeted time limits', async () => {
Expand Down Expand Up @@ -618,7 +620,7 @@ describe('IndexedDB benchmarks', () => {
expect(fetched.length).toBe(100);
}, 1);

expect(time).toBeLessThan(100);
expect(time).toBeLessThan(JOIN_TIME_LIMIT);
});

test('wide joins with outer level ORs operate within expected time limits', async () => {
Expand Down Expand Up @@ -650,7 +652,7 @@ describe('IndexedDB benchmarks', () => {
expect(fetched.length).toBe(100);
}, 1);

expect(time).toBeLessThan(100);
expect(time).toBeLessThan(JOIN_TIME_LIMIT);
});

test('semi-wide joins (limit 7) with outer level ORs operate within expected time limits', async () => {
Expand Down Expand Up @@ -685,6 +687,6 @@ describe('IndexedDB benchmarks', () => {
expect(fetched.length).toBe(size);
}, 1);

expect(time).toBeLessThan(100);
expect(time).toBeLessThan(JOIN_TIME_LIMIT);
});
});

0 comments on commit 711a761

Please sign in to comment.