Skip to content

Commit 7b9d18d

Browse files
committed
Spec test clean up
1 parent 14ed4f3 commit 7b9d18d

14 files changed

+69
-69
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ describeSpec('Bundles:', ['no-ios'], () => {
178178
spec()
179179
// TODO(b/160878667): Figure out what happens when memory eager GC is on
180180
// a bundle is loaded.
181-
.withEagerGCForMemoryPersistence(false)
181+
.ensureManualLruGC()
182182
.userListens(query1)
183183
.watchAcksFull(query1, 250, docA)
184184
.expectEvents(query1, {
@@ -224,7 +224,7 @@ describeSpec('Bundles:', ['no-ios'], () => {
224224

225225
return (
226226
spec()
227-
.withEagerGCForMemoryPersistence(false)
227+
.ensureManualLruGC()
228228
.userListens(query1)
229229
.watchAcksFull(query1, 250, docA)
230230
.expectEvents(query1, {
@@ -260,7 +260,7 @@ describeSpec('Bundles:', ['no-ios'], () => {
260260

261261
return (
262262
spec()
263-
.withEagerGCForMemoryPersistence(false)
263+
.ensureManualLruGC()
264264
.userListens(query1)
265265
.watchAcksFull(query1, 250)
266266
// Backend tells is there is no such doc.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describeSpec('Existence Filters:', [], () => {
6969
const doc1 = doc('collection/1', 2000, { v: 2 });
7070
return (
7171
spec()
72-
.withEagerGCForMemoryPersistence(false)
72+
.ensureManualLruGC()
7373
.userListens(query1)
7474
.watchAcksFull(query1, 1000, doc1)
7575
.expectEvents(query1, { added: [doc1] })

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describeSpec('Garbage Collection:', [], () => {
4444
const query1 = query('collection');
4545
const docA = doc('collection/a', 1000, { key: 'a' });
4646
return spec()
47-
.withEagerGCForMemoryPersistence(false)
47+
.ensureManualLruGC()
4848
.userListens(query1)
4949
.watchAcksFull(query1, 1000, docA)
5050
.expectEvents(query1, { added: [docA] })
@@ -61,7 +61,7 @@ describeSpec('Garbage Collection:', [], () => {
6161
const query1 = query('collection');
6262
const docA = doc('collection/a', 1000, { key: 'a' });
6363
return spec()
64-
.withEagerGCForMemoryPersistence(false)
64+
.ensureManualLruGC()
6565
.userListens(query1)
6666
.watchAcksFull(query1, 1000, docA)
6767
.expectEvents(query1, { added: [docA] })
@@ -81,7 +81,7 @@ describeSpec('Garbage Collection:', [], () => {
8181
const docA = doc('collection/a', 1000, { key: 'a' });
8282
return (
8383
spec()
84-
.withEagerGCForMemoryPersistence(false)
84+
.ensureManualLruGC()
8585
.userListens(query1)
8686
.watchAcksFull(query1, 1000, docA)
8787
.expectEvents(query1, { added: [docA] })
@@ -110,7 +110,7 @@ describeSpec('Garbage Collection:', [], () => {
110110
const docD = doc('collection/d', 1000, { key: 'd' });
111111
return (
112112
spec()
113-
.withEagerGCForMemoryPersistence(false)
113+
.ensureManualLruGC()
114114
.userListens(queryFull)
115115
.watchAcksFull(queryFull, 1000, docA, docB, docC, docD)
116116
.expectEvents(queryFull, { added: [docA, docB, docC, docD] })

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ describeSpec('Limbo Documents:', [], () => {
203203
return (
204204
spec()
205205
// No GC so we can keep the cache populated.
206-
.withEagerGCForMemoryPersistence(false)
206+
.ensureManualLruGC()
207207

208208
// Full query to populate the cache with docA and docB
209209
.userListens(fullQuery)
@@ -275,7 +275,7 @@ describeSpec('Limbo Documents:', [], () => {
275275
return (
276276
spec()
277277
// No GC so we can keep the cache populated.
278-
.withEagerGCForMemoryPersistence(false)
278+
.ensureManualLruGC()
279279

280280
// Full query to populate the cache with docA and docB
281281
.userListens(fullQuery)
@@ -512,7 +512,7 @@ describeSpec('Limbo Documents:', [], () => {
512512

513513
return (
514514
spec()
515-
.withEagerGCForMemoryPersistence(false)
515+
.ensureManualLruGC()
516516
.userSets('collection/a', { matches: true })
517517
.userSets('collection/b', { matches: true })
518518
.writeAcks('collection/a', 1000)
@@ -926,7 +926,7 @@ describeSpec('Limbo Documents:', [], () => {
926926

927927
return (
928928
spec()
929-
.withEagerGCForMemoryPersistence(false)
929+
.ensureManualLruGC()
930930

931931
// Start a limbo resolution listen for a document (doc1).
932932
.userListens(fullQuery)
@@ -964,7 +964,7 @@ describeSpec('Limbo Documents:', [], () => {
964964

965965
return (
966966
spec()
967-
.withEagerGCForMemoryPersistence(false)
967+
.ensureManualLruGC()
968968
.withMaxConcurrentLimboResolutions(1)
969969

970970
// Max out the number of active limbo resolutions.
@@ -1014,7 +1014,7 @@ describeSpec('Limbo Documents:', [], () => {
10141014

10151015
return (
10161016
spec()
1017-
.withEagerGCForMemoryPersistence(false)
1017+
.ensureManualLruGC()
10181018
.withMaxConcurrentLimboResolutions(1)
10191019

10201020
// Max out the number of active limbo resolutions.

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describeSpec('Limits:', [], () => {
5151
const doc2 = doc('collection/b', 1000, { key: 'b' });
5252

5353
return spec()
54-
.withEagerGCForMemoryPersistence(false)
54+
.ensureManualLruGC()
5555
.userListens(query1)
5656
.watchAcksFull(query1, 1000, doc1, doc2)
5757
.expectEvents(query1, {
@@ -165,7 +165,7 @@ describeSpec('Limits:', [], () => {
165165
const doc2 = doc('collection/b', 1002, { matches: true });
166166
const doc3 = doc('collection/c', 1000, { matches: true });
167167
return spec()
168-
.withEagerGCForMemoryPersistence(false)
168+
.ensureManualLruGC()
169169
.userListens(fullQuery)
170170
.watchAcksFull(fullQuery, 1002, doc1, doc2, doc3)
171171
.expectEvents(fullQuery, { added: [doc1, doc2, doc3] })
@@ -192,7 +192,7 @@ describeSpec('Limits:', [], () => {
192192
const doc2 = doc('collection/b', 1002, { matches: true });
193193
const doc3 = doc('collection/c', 1003, { matches: true });
194194
return spec()
195-
.withEagerGCForMemoryPersistence(false)
195+
.ensureManualLruGC()
196196
.userListens(fullQuery)
197197
.watchAcksFull(fullQuery, 1003, doc1, doc2, doc3)
198198
.expectEvents(fullQuery, { added: [doc1, doc2, doc3] })
@@ -226,7 +226,7 @@ describeSpec('Limits:', [], () => {
226226
const doc2 = doc('collection/b', 1002, { pos: 2 });
227227
const doc3 = doc('collection/c', 1003, { pos: 3 });
228228
return spec()
229-
.withEagerGCForMemoryPersistence(false)
229+
.ensureManualLruGC()
230230
.userListens(fullQuery)
231231
.watchAcksFull(fullQuery, 1003, doc1, doc2, doc3)
232232
.expectEvents(fullQuery, { added: [doc1, doc2, doc3] })
@@ -262,7 +262,7 @@ describeSpec('Limits:', [], () => {
262262
const doc2 = doc('collection/b', 1002, { pos: 2 });
263263
const doc3 = doc('collection/c', 1003, { pos: 3 });
264264
return spec()
265-
.withEagerGCForMemoryPersistence(false)
265+
.ensureManualLruGC()
266266
.userListens(fullQuery)
267267
.watchAcksFull(fullQuery, 1003, doc1, doc2, doc3)
268268
.expectEvents(fullQuery, { added: [doc1, doc2, doc3] })
@@ -303,7 +303,7 @@ describeSpec('Limits:', [], () => {
303303

304304
return (
305305
spec()
306-
.withEagerGCForMemoryPersistence(false)
306+
.ensureManualLruGC()
307307
.userListens(limitQuery)
308308
.watchAcksFull(limitQuery, 1001, firstDocument)
309309
.expectEvents(limitQuery, { added: [firstDocument] })
@@ -379,7 +379,7 @@ describeSpec('Limits:', [], () => {
379379

380380
return (
381381
spec()
382-
.withEagerGCForMemoryPersistence(false)
382+
.ensureManualLruGC()
383383
// We issue a limit query with an orderBy constraint.
384384
.userListens(limitQuery)
385385
.watchAcksFull(limitQuery, 2001, firstDocument)

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ describeSpec('Listens:', [], () => {
210210
const query1 = query('collection');
211211

212212
return spec()
213-
.withEagerGCForMemoryPersistence(false)
213+
.ensureManualLruGC()
214214
.userListens(query1)
215215
.watchAcks(query1)
216216
.watchRemoves(
@@ -265,7 +265,7 @@ describeSpec('Listens:', [], () => {
265265
return (
266266
spec()
267267
// Disable GC so the cache persists across listens.
268-
.withEagerGCForMemoryPersistence(false)
268+
.ensureManualLruGC()
269269
.userListens(query1)
270270
.watchAcksFull(query1, 1000, docAv1)
271271
.expectEvents(query1, { added: [docAv1] })
@@ -301,7 +301,7 @@ describeSpec('Listens:', [], () => {
301301
return (
302302
spec()
303303
// Disable GC so the cache persists across listens.
304-
.withEagerGCForMemoryPersistence(false)
304+
.ensureManualLruGC()
305305
.userListens(query1)
306306
.watchAcksFull(query1, 1000, docAv1)
307307
.expectEvents(query1, { added: [docAv1] })
@@ -334,7 +334,7 @@ describeSpec('Listens:', [], () => {
334334
return (
335335
spec()
336336
// Disable GC so the cache persists across listens.
337-
.withEagerGCForMemoryPersistence(false)
337+
.ensureManualLruGC()
338338
.userListens(visibleQuery)
339339
.watchAcksFull(visibleQuery, 1000, docAv1)
340340
.expectEvents(visibleQuery, { added: [docAv1] })
@@ -377,7 +377,7 @@ describeSpec('Listens:', [], () => {
377377
return (
378378
spec()
379379
// Disable GC so the cache persists across listens.
380-
.withEagerGCForMemoryPersistence(false)
380+
.ensureManualLruGC()
381381
.userListens(visibleQuery)
382382
.watchAcksFull(visibleQuery, 1000, docAv1)
383383
.expectEvents(visibleQuery, { added: [docAv1] })
@@ -474,7 +474,7 @@ describeSpec('Listens:', [], () => {
474474
const docB = doc('collection/b', 1000, { key: 'a' });
475475
return (
476476
spec()
477-
.withEagerGCForMemoryPersistence(false)
477+
.ensureManualLruGC()
478478
// Add a collection query with two documents, one of which gets deleted
479479
// (the second document guarantees that we later raise an event from
480480
// cache).
@@ -508,7 +508,7 @@ describeSpec('Listens:', [], () => {
508508
const docA = doc('collection/a', 1000, { key: 'a' });
509509
const deletedDocA = deletedDoc('collection/a', 2000);
510510
return spec()
511-
.withEagerGCForMemoryPersistence(false)
511+
.ensureManualLruGC()
512512
.userListens(query1)
513513
.watchAcksFull(query1, 1000, docA)
514514
.expectEvents(query1, { added: [docA] })
@@ -528,7 +528,7 @@ describeSpec('Listens:', [], () => {
528528
const docA = doc('collection/a', 1000, { key: 'a' });
529529
const docB = doc('collection/b', 2000, { key: 'b' });
530530
return spec()
531-
.withEagerGCForMemoryPersistence(false)
531+
.ensureManualLruGC()
532532
.userListens(query1)
533533
.watchAcksFull(query1, 1000, docA)
534534
.expectEvents(query1, { added: [docA] })
@@ -548,7 +548,7 @@ describeSpec('Listens:', [], () => {
548548
const docA = doc('collection/a', 1000, { key: 'a' });
549549
return (
550550
spec()
551-
.withEagerGCForMemoryPersistence(false)
551+
.ensureManualLruGC()
552552
.userListens(query1)
553553
.watchAcks(query1)
554554
.watchSends({ affects: [query1] }, docA)
@@ -570,7 +570,7 @@ describeSpec('Listens:', [], () => {
570570
const query1 = query('collection');
571571

572572
return spec()
573-
.withEagerGCForMemoryPersistence(false)
573+
.ensureManualLruGC()
574574
.userListens(query1)
575575
.watchRemoves(
576576
query1,
@@ -586,7 +586,7 @@ describeSpec('Listens:', [], () => {
586586
const query1 = query('collection');
587587
const docA = doc('collection/a', 2000, { key: 'a' });
588588
return spec()
589-
.withEagerGCForMemoryPersistence(false)
589+
.ensureManualLruGC()
590590
.userListens(query1)
591591
.watchAcksFull(query1, 1000)
592592
.expectEvents(query1, {})
@@ -606,7 +606,7 @@ describeSpec('Listens:', [], () => {
606606
const query1 = query('collection', filter('array', 'array-contains', 42));
607607
const docA = doc('collection/a', 2000, { foo: 'bar', array: [1, 42, 3] });
608608
return spec()
609-
.withEagerGCForMemoryPersistence(false)
609+
.ensureManualLruGC()
610610
.userListens(query1)
611611
.watchAcksFull(query1, 1000)
612612
.expectEvents(query1, {})
@@ -628,7 +628,7 @@ describeSpec('Listens:', [], () => {
628628

629629
return (
630630
spec()
631-
.withEagerGCForMemoryPersistence(false)
631+
.ensureManualLruGC()
632632
.userListens(query1)
633633
.watchAcksFull(query1, 1000, docA)
634634
.expectEvents(query1, { added: [docA] })
@@ -657,7 +657,7 @@ describeSpec('Listens:', [], () => {
657657

658658
return (
659659
spec()
660-
.withEagerGCForMemoryPersistence(false)
660+
.ensureManualLruGC()
661661
.userListens(query1)
662662
.watchAcksFull(query1, 1000, docA)
663663
.expectEvents(query1, { added: [docA] })
@@ -690,7 +690,7 @@ describeSpec('Listens:', [], () => {
690690

691691
return (
692692
spec()
693-
.withEagerGCForMemoryPersistence(false)
693+
.ensureManualLruGC()
694694
.userListens(query1)
695695
.watchAcksFull(query1, initialVersion, docA)
696696
.expectEvents(query1, { added: [docA] })
@@ -1704,7 +1704,7 @@ describeSpec('Listens:', [], () => {
17041704
return (
17051705
spec()
17061706
// Disable GC so the cache persists across listens.
1707-
.withEagerGCForMemoryPersistence(false)
1707+
.ensureManualLruGC()
17081708
// Populate the cache with the empty query results.
17091709
.userListens(query1)
17101710
.watchAcksFull(query1, 1000)
@@ -1731,7 +1731,7 @@ describeSpec('Listens:', [], () => {
17311731
return (
17321732
spec()
17331733
// Disable GC so the cache persists across listens.
1734-
.withEagerGCForMemoryPersistence(false)
1734+
.ensureManualLruGC()
17351735
// Populate the cache with the empty query results.
17361736
.userListens(query1)
17371737
.watchAcksFull(query1, 1000, doc1)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describeSpec('OrderBy:', [], () => {
5757
const docB = doc('collection/b', 1001, { key: 'b', sort: 1 });
5858

5959
return spec()
60-
.withEagerGCForMemoryPersistence(false)
60+
.ensureManualLruGC()
6161
.userListens(query1)
6262
.watchAcksFull(query1, 1002, docA, docB)
6363
.expectEvents(query1, { added: [docB, docA] })

0 commit comments

Comments
 (0)