Batch storage item read requests

This commit is contained in:
Fedor Indutny 2022-04-12 17:50:17 -07:00 committed by GitHub
parent 2f5e4f1b98
commit 610ebdd1e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 144 additions and 29 deletions

View file

@ -9,8 +9,9 @@ import createDebug from 'debug';
import type { Device, PrimaryDevice } from '@signalapp/mock-server';
import { Server, loadCertificates } from '@signalapp/mock-server';
import { App } from './playwright';
import { MAX_READ_KEYS as MAX_STORAGE_READ_KEYS } from '../services/storageConstants';
import * as durations from '../util/durations';
import { App } from './playwright';
const debug = createDebug('mock:bootstrap');
@ -97,7 +98,7 @@ type BootstrapInternalOptions = Pick<BootstrapOptions, 'extraConfig'> &
// the same between different test runs.
//
export class Bootstrap {
public readonly server = new Server();
public readonly server: Server;
private readonly options: BootstrapInternalOptions;
private privContacts?: ReadonlyArray<PrimaryDevice>;
@ -107,6 +108,11 @@ export class Bootstrap {
private timestamp: number = Date.now() - durations.MONTH;
constructor(options: BootstrapOptions = {}) {
this.server = new Server({
// Limit number of storage read keys for easier testing
maxStorageReadKeys: MAX_STORAGE_READ_KEYS,
});
this.options = {
linkedDevices: 5,
contactCount: MAX_CONTACTS,