@@ -31,6 +31,11 @@ export const SYNC_SNAPSHOT_PATH = path.resolve(__dirname, '../__snapshots/sync.t
3131 */
3232export function registerSyncTests ( factory : storage . TestStorageFactory ) {
3333 const tracker = new sync . RequestTracker ( ) ;
34+ const syncContext = new sync . SyncContext ( {
35+ maxBuckets : 10 ,
36+ maxParameterQueryResults : 10 ,
37+ maxDataFetchConcurrency : 2
38+ } ) ;
3439
3540 test ( 'sync global data' , async ( ) => {
3641 await using f = await factory ( ) ;
@@ -67,6 +72,7 @@ export function registerSyncTests(factory: storage.TestStorageFactory) {
6772 } ) ;
6873
6974 const stream = sync . streamResponse ( {
75+ syncContext,
7076 bucketStorage : bucketStorage ,
7177 syncRules : bucketStorage . getParsedSyncRules ( test_utils . PARSE_OPTIONS ) ,
7278 params : {
@@ -128,7 +134,8 @@ bucket_definitions:
128134 } ) ;
129135
130136 const stream = sync . streamResponse ( {
131- bucketStorage : bucketStorage ,
137+ syncContext,
138+ bucketStorage,
132139 syncRules : bucketStorage . getParsedSyncRules ( test_utils . PARSE_OPTIONS ) ,
133140 params : {
134141 buckets : [ ] ,
@@ -191,7 +198,8 @@ bucket_definitions:
191198 } ) ;
192199
193200 const stream = sync . streamResponse ( {
194- bucketStorage : bucketStorage ,
201+ syncContext,
202+ bucketStorage,
195203 syncRules : bucketStorage . getParsedSyncRules ( test_utils . PARSE_OPTIONS ) ,
196204 params : {
197205 buckets : [ ] ,
@@ -276,7 +284,8 @@ bucket_definitions:
276284 } ) ;
277285
278286 const stream = sync . streamResponse ( {
279- bucketStorage : bucketStorage ,
287+ syncContext,
288+ bucketStorage,
280289 syncRules : bucketStorage . getParsedSyncRules ( test_utils . PARSE_OPTIONS ) ,
281290 params : {
282291 buckets : [ ] ,
@@ -302,7 +311,7 @@ bucket_definitions:
302311 receivedCompletions ++ ;
303312 if ( receivedCompletions == 1 ) {
304313 // Trigger an empty bucket update.
305- await bucketStorage . createManagedWriteCheckpoint ( { user_id : '' , heads : { '1' : '1/0' } } ) ;
314+ await bucketStorage . createManagedWriteCheckpoint ( { user_id : '' , heads : { '1' : '1/0' } } ) ;
306315 await bucketStorage . startBatch ( test_utils . BATCH_OPTIONS , async ( batch ) => {
307316 await batch . commit ( '1/0' ) ;
308317 } ) ;
@@ -342,7 +351,8 @@ bucket_definitions:
342351 } ) ;
343352
344353 const stream = sync . streamResponse ( {
345- bucketStorage : bucketStorage ,
354+ syncContext,
355+ bucketStorage,
346356 syncRules : bucketStorage . getParsedSyncRules ( test_utils . PARSE_OPTIONS ) ,
347357 params : {
348358 buckets : [ ] ,
@@ -371,7 +381,8 @@ bucket_definitions:
371381 await bucketStorage . autoActivate ( ) ;
372382
373383 const stream = sync . streamResponse ( {
374- bucketStorage : bucketStorage ,
384+ syncContext,
385+ bucketStorage,
375386 syncRules : bucketStorage . getParsedSyncRules ( test_utils . PARSE_OPTIONS ) ,
376387 params : {
377388 buckets : [ ] ,
@@ -398,7 +409,8 @@ bucket_definitions:
398409 await bucketStorage . autoActivate ( ) ;
399410
400411 const stream = sync . streamResponse ( {
401- bucketStorage : bucketStorage ,
412+ syncContext,
413+ bucketStorage,
402414 syncRules : bucketStorage . getParsedSyncRules ( test_utils . PARSE_OPTIONS ) ,
403415 params : {
404416 buckets : [ ] ,
@@ -461,7 +473,8 @@ bucket_definitions:
461473 const exp = Date . now ( ) / 1000 + 0.1 ;
462474
463475 const stream = sync . streamResponse ( {
464- bucketStorage : bucketStorage ,
476+ syncContext,
477+ bucketStorage,
465478 syncRules : bucketStorage . getParsedSyncRules ( test_utils . PARSE_OPTIONS ) ,
466479 params : {
467480 buckets : [ ] ,
@@ -521,7 +534,8 @@ bucket_definitions:
521534 } ) ;
522535
523536 const stream = sync . streamResponse ( {
524- bucketStorage : bucketStorage ,
537+ syncContext,
538+ bucketStorage,
525539 syncRules : bucketStorage . getParsedSyncRules ( test_utils . PARSE_OPTIONS ) ,
526540 params : {
527541 buckets : [ ] ,
@@ -644,7 +658,8 @@ bucket_definitions:
644658 } ) ;
645659
646660 const params : sync . SyncStreamParameters = {
647- bucketStorage : bucketStorage ,
661+ syncContext,
662+ bucketStorage,
648663 syncRules : bucketStorage . getParsedSyncRules ( test_utils . PARSE_OPTIONS ) ,
649664 params : {
650665 buckets : [ ] ,
0 commit comments