Skip to content

Commit ab2e73d

Browse files
Fix CI (#3066)
1 parent 0131e1f commit ab2e73d

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

packages/firestore/test/unit/local/indexeddb_persistence.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ describe('IndexedDb: allowTabSynchronization', () => {
11441144
'clientA',
11451145
/* multiClient= */ false,
11461146
async db => {
1147-
db.injectFailures = true;
1147+
db.injectFailures = { updateClientMetadataAndTryBecomePrimary: true };
11481148
await expect(db.start()).to.eventually.be.rejectedWith(
11491149
'Failed to obtain exclusive access to the persistence layer.'
11501150
);
@@ -1158,7 +1158,7 @@ describe('IndexedDb: allowTabSynchronization', () => {
11581158
'clientA',
11591159
/* multiClient= */ true,
11601160
async db => {
1161-
db.injectFailures = true;
1161+
db.injectFailures = { updateClientMetadataAndTryBecomePrimary: true };
11621162
await db.start();
11631163
await db.shutdown();
11641164
}
@@ -1167,10 +1167,10 @@ describe('IndexedDb: allowTabSynchronization', () => {
11671167

11681168
it('ignores intermittent IndexedDbTransactionError during lease refresh', async () => {
11691169
await withPersistence('clientA', async (db, _, queue) => {
1170-
db.injectFailures = true;
1170+
db.injectFailures = { updateClientMetadataAndTryBecomePrimary: true };
11711171
await queue.runDelayedOperationsEarly(TimerId.ClientMetadataRefresh);
11721172
await queue.enqueue(() => {
1173-
db.injectFailures = false;
1173+
db.injectFailures = undefined;
11741174
return db.runTransaction('check success', 'readwrite-primary', () =>
11751175
PersistencePromise.resolve()
11761176
);

packages/firestore/test/unit/specs/spec_test_components.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import { expect } from 'chai';
5959
export class MockMemoryPersistence extends MemoryPersistence {
6060
injectFailures?: SpecDatabaseFailures;
6161

62-
runTransaction<T>(
62+
async runTransaction<T>(
6363
action: string,
6464
mode: PersistenceTransactionMode,
6565
transactionOperation: (
@@ -78,7 +78,7 @@ export class MockMemoryPersistence extends MemoryPersistence {
7878
export class MockIndexedDbPersistence extends IndexedDbPersistence {
7979
injectFailures?: SpecDatabaseFailures;
8080

81-
runTransaction<T>(
81+
async runTransaction<T>(
8282
action: string,
8383
mode: PersistenceTransactionMode,
8484
transactionOperation: (

packages/firestore/test/unit/specs/spec_test_runner.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,8 @@ export type PersistenceAction =
12141214
| 'Lookup mutation documents'
12151215
| 'Get target data'
12161216
| 'Get new document changes'
1217-
| 'Synchronize last document change read time';
1217+
| 'Synchronize last document change read time'
1218+
| 'updateClientMetadataAndTryBecomePrimary';
12181219

12191220
/** Specifies failure or success for a list of database actions. */
12201221
export type SpecDatabaseFailures = Partial<

0 commit comments

Comments
 (0)