@fluidframework/test-utils 0.50.1 → 0.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/test-utils";
8
- export declare const pkgVersion = "0.50.1";
8
+ export declare const pkgVersion = "0.51.1";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/test-utils";
11
- exports.pkgVersion = "0.50.1";
11
+ exports.pkgVersion = "0.51.1";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/test-utils\";\nexport const pkgVersion = \"0.50.1\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,4BAA4B,CAAC;AACvC,QAAA,UAAU,GAAG,QAAQ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/test-utils\";\nexport const pkgVersion = \"0.51.1\";\n"]}
@@ -18,6 +18,7 @@ export interface IOpProcessingController {
18
18
  resumeProcessing(...containers: IContainer[]): void;
19
19
  }
20
20
  export interface ITestObjectProvider {
21
+ createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint;
21
22
  createLoader(packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>, options?: ITestLoaderOptions, detachedBlobStorage?: IDetachedBlobStorage): IHostLoader;
22
23
  createContainer(entryPoint: fluidEntryPoint, options?: ITestLoaderOptions): Promise<IContainer>;
23
24
  loadContainer(entryPoint: fluidEntryPoint, options?: ITestLoaderOptions, requestHeader?: IRequestHeader): Promise<IContainer>;
@@ -67,7 +68,7 @@ export declare const createDocumentId: () => string;
67
68
  export declare class TestObjectProvider {
68
69
  readonly LoaderConstructor: typeof Loader;
69
70
  readonly driver: ITestDriver;
70
- private readonly createFluidEntryPoint;
71
+ readonly createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint;
71
72
  private readonly _loaderContainerTracker;
72
73
  private _documentServiceFactory;
73
74
  private _urlResolver;
@@ -1 +1 @@
1
- {"version":3,"file":"testObjectProvider.d.ts","sourceRoot":"","sources":["../src/testObjectProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,EAA0B,MAAM,kCAAkC,CAAC;AACnH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEzG,OAAO,EAAE,WAAW,EAA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M,GAAG,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;QACxD,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACvG,MAAM,yCAAsB,CAAC,SAAS,CAAC,CAAC;QACxC,OAAO,SAAS,CAAC;IACrB,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,CAAC,uBAAuB,GAAG,SAAS,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,KAAK,CAAC,kBAAkB;QAC3B,OAAO,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,EAAE,CAAC;IAC7D,CAAC;IAED,gBAAgB,CAAC,WAAqC;QAClD,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;CACJ;AAnLD,gDAmLC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainer, IHostLoader, ILoaderOptions } from \"@fluidframework/container-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport { Container, IDetachedBlobStorage, Loader, waitContainerToCatchUp } from \"@fluidframework/container-loader\";\nimport { IContainerRuntimeOptions } from \"@fluidframework/container-runtime\";\nimport { IFluidCodeDetails, IRequestHeader } from \"@fluidframework/core-interfaces\";\nimport { IDocumentServiceFactory, IResolvedUrl, IUrlResolver } from \"@fluidframework/driver-definitions\";\nimport { ensureFluidResolvedUrl } from \"@fluidframework/driver-utils\";\nimport { ITestDriver, TestDriverTypes } from \"@fluidframework/test-driver-definitions\";\nimport { v4 as uuid } from \"uuid\";\nimport { ChildLogger, MultiSinkLogger } from \"@fluidframework/telemetry-utils\";\nimport { LoaderContainerTracker } from \"./loaderContainerTracker\";\nimport { fluidEntryPoint, LocalCodeLoader } from \"./localCodeLoader\";\nimport { createAndAttachContainer } from \"./localLoader\";\nimport { ChannelFactoryRegistry } from \"./testFluidObject\";\n\nconst defaultCodeDetails: IFluidCodeDetails = {\n package: \"defaultTestPackage\",\n config: {},\n};\n\nexport interface IOpProcessingController {\n processIncoming(...containers: IContainer[]): Promise<void>;\n processOutgoing(...containers: IContainer[]): Promise<void>;\n pauseProcessing(...containers: IContainer[]): Promise<void>;\n resumeProcessing(...containers: IContainer[]): void;\n}\n\nexport interface ITestObjectProvider {\n createLoader(\n packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,\n options?: ITestLoaderOptions,\n detachedBlobStorage?: IDetachedBlobStorage,\n ): IHostLoader;\n createContainer(entryPoint: fluidEntryPoint, options?: ITestLoaderOptions): Promise<IContainer>;\n loadContainer(\n entryPoint: fluidEntryPoint,\n options?: ITestLoaderOptions,\n requestHeader?: IRequestHeader,\n ): Promise<IContainer>;\n\n /**\n * Used to create a test Container. The Loader/ContainerRuntime/DataRuntime might be different versioned.\n * In generateLocalCompatTest(), this Container and its runtime will be arbitrarily-versioned.\n */\n makeTestLoader(testContainerConfig?: ITestContainerConfig, detachedBlobStorage?: IDetachedBlobStorage): IHostLoader,\n makeTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer>,\n loadTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer>,\n /**\n *\n * @param url - Resolved container URL\n */\n updateDocumentId(url: IResolvedUrl | undefined): void,\n\n logger: ITelemetryBaseLogger,\n documentServiceFactory: IDocumentServiceFactory,\n urlResolver: IUrlResolver,\n defaultCodeDetails: IFluidCodeDetails,\n opProcessingController: IOpProcessingController,\n\n ensureSynchronized(): Promise<void>;\n reset(): void,\n\n documentId: string,\n driver: ITestDriver;\n}\n\nexport enum DataObjectFactoryType {\n Primed, // default\n Test,\n}\n\nexport interface ITestContainerConfig {\n /** TestFluidDataObject instead of PrimedDataStore */\n fluidDataObjectType?: DataObjectFactoryType,\n\n /** An array of channel name and DDS factory pair to create on container creation time */\n registry?: ChannelFactoryRegistry,\n\n /** Container runtime options for the container instance */\n runtimeOptions?: IContainerRuntimeOptions,\n\n /** Loader options for the loader used to create containers */\n loaderOptions?: ITestLoaderOptions,\n}\n\n// new interface to help inject custom loggers to tests\nexport interface ITestLoaderOptions extends ILoaderOptions {\n logger?: ITelemetryBaseLogger;\n}\n\nexport const createDocumentId = (): string => uuid();\n\ninterface IDocumentIdStrategy {\n get(): string;\n update(resolvedUrl?: IResolvedUrl): void;\n reset(): void;\n}\n\n/**\n * Document ID is treated differently by test drivers. The key difference is in generating\n * a new container ID and accessing the container in multi-instance test cases.\n */\nfunction getDocumentIdStrategy(type?: TestDriverTypes): IDocumentIdStrategy {\n let documentId = createDocumentId();\n switch (type) {\n case \"odsp\":\n return {\n get: () => documentId,\n update: () => { }, // do not update the document ID in odsp test cases\n reset: () => documentId = createDocumentId(),\n };\n default:\n return {\n get: () => documentId,\n update: (resolvedUrl?: IResolvedUrl) => {\n // Extract the document ID from the resolved container's URL and reset the ID property\n ensureFluidResolvedUrl(resolvedUrl);\n documentId = resolvedUrl.id ?? documentId;\n },\n reset: () => documentId = createDocumentId(),\n };\n }\n}\n\n/**\n * Shared base class for test object provider. Contain code for loader and container creation and loading\n */\nexport class TestObjectProvider {\n private readonly _loaderContainerTracker = new LoaderContainerTracker();\n private _documentServiceFactory: IDocumentServiceFactory | undefined;\n private _urlResolver: IUrlResolver | undefined;\n private _logger: ITelemetryBaseLogger | undefined;\n private readonly _documentIdStrategy: IDocumentIdStrategy;\n\n /**\n * Manage objects for loading and creating container, including the driver, loader, and OpProcessingController\n * @param createFluidEntryPoint - callback to create a fluidEntryPoint, with an optional set of channel name\n * and factory for TestFluidObject\n */\n constructor(\n public readonly LoaderConstructor: typeof Loader,\n public readonly driver: ITestDriver,\n private readonly createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint,\n ) {\n this._documentIdStrategy = getDocumentIdStrategy(driver.type);\n }\n\n get logger() {\n if (this._logger === undefined) {\n this._logger = ChildLogger.create(getTestLogger?.(), undefined,\n {\n all: {\n driverType: this.driver.type,\n driverEndpointName: this.driver.endpointName,\n driverTenantName: this.driver.tenantName,\n driverUserIndex: this.driver.userIndex,\n },\n });\n }\n return this._logger;\n }\n\n get documentServiceFactory() {\n if (!this._documentServiceFactory) {\n this._documentServiceFactory = this.driver.createDocumentServiceFactory();\n }\n return this._documentServiceFactory;\n }\n\n get urlResolver() {\n if (!this._urlResolver) {\n this._urlResolver = this.driver.createUrlResolver();\n }\n return this._urlResolver;\n }\n\n get documentId() {\n return this._documentIdStrategy.get();\n }\n\n get defaultCodeDetails() {\n return defaultCodeDetails;\n }\n\n get opProcessingController(): IOpProcessingController {\n return this._loaderContainerTracker;\n }\n\n /**\n * Create a loader. Containers created/loaded through this loader will be added to the OpProcessingController.\n *\n * Only the version of the loader will vary based on compat config. The version of\n * containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.\n *\n * @param packageEntries - list of code details and fluidEntryPoint pairs.\n */\n public createLoader(\n packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,\n options?: ITestLoaderOptions,\n detachedBlobStorage?: IDetachedBlobStorage,\n ) {\n const multiSinkLogger = new MultiSinkLogger();\n multiSinkLogger.addLogger(this.logger);\n if (options?.logger !== undefined) {\n multiSinkLogger.addLogger(options.logger);\n }\n\n const codeLoader = new LocalCodeLoader(packageEntries);\n const loader = new this.LoaderConstructor({\n urlResolver: this.urlResolver,\n documentServiceFactory: this.documentServiceFactory,\n codeLoader,\n logger: multiSinkLogger,\n options,\n detachedBlobStorage,\n });\n this._loaderContainerTracker.add(loader);\n return loader;\n }\n\n /**\n * Create a container using a default document id and code details.\n * Container created is automatically added to the OpProcessingController to manage op flow\n *\n * Only the version of the loader will vary based on compat config. The version of\n * containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.\n *\n * @param packageEntries - list of code details and fluidEntryPoint pairs.\n */\n public async createContainer(entryPoint: fluidEntryPoint, options?: ITestLoaderOptions) {\n const loader = this.createLoader([[defaultCodeDetails, entryPoint]], options);\n const container = await createAndAttachContainer(\n defaultCodeDetails,\n loader,\n this.driver.createCreateNewRequest(this.documentId),\n );\n // r11s driver will generate a new ID for the new container.\n // update the document ID with the actual ID of the attached container.\n this._documentIdStrategy.update(container.resolvedUrl);\n return container;\n }\n\n public async loadContainer(entryPoint: fluidEntryPoint, options?: ITestLoaderOptions,\n requestHeader?: IRequestHeader) {\n const loader = this.createLoader([[defaultCodeDetails, entryPoint]], options);\n return loader.resolve({ url: await this.driver.createContainerUrl(this.documentId), headers: requestHeader });\n }\n\n /**\n * Make a test loader. Containers created/loaded through this loader will be added to the OpProcessingController.\n * The version of the loader/containerRuntime/dataRuntime may vary based on compat config of the current run\n * @param testContainerConfig - optional configuring the test Container\n */\n public makeTestLoader(testContainerConfig?: ITestContainerConfig, detachedBlobStorage?: IDetachedBlobStorage) {\n return this.createLoader(\n [[defaultCodeDetails, this.createFluidEntryPoint(testContainerConfig)]],\n testContainerConfig?.loaderOptions,\n detachedBlobStorage,\n );\n }\n\n /**\n * Make a container using a default document id and code details\n * Container loaded is automatically added to the OpProcessingController to manage op flow\n * @param testContainerConfig - optional configuring the test Container\n */\n public async makeTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer> {\n const loader = this.makeTestLoader(testContainerConfig);\n const container =\n await createAndAttachContainer(\n defaultCodeDetails,\n loader,\n this.driver.createCreateNewRequest(this.documentId));\n // r11s driver will generate a new ID for the new container.\n // update the document ID with the actual ID of the attached container.\n this._documentIdStrategy.update(container.resolvedUrl);\n return container;\n }\n\n /**\n * Load a container using a default document id and code details.\n * Container loaded is automatically added to the OpProcessingController to manage op flow\n * @param testContainerConfig - optional configuring the test Container\n */\n public async loadTestContainer(testContainerConfig?: ITestContainerConfig): Promise<Container> {\n const loader = this.makeTestLoader(testContainerConfig);\n const container = await loader.resolve({ url: await this.driver.createContainerUrl(this.documentId) });\n await waitContainerToCatchUp(container);\n return container;\n }\n\n public reset() {\n this._loaderContainerTracker.reset();\n this._documentServiceFactory = undefined;\n this._urlResolver = undefined;\n this._documentIdStrategy.reset();\n this._logger = undefined;\n }\n\n public async ensureSynchronized() {\n return this._loaderContainerTracker.ensureSynchronized();\n }\n\n updateDocumentId(resolvedUrl: IResolvedUrl | undefined) {\n this._documentIdStrategy.update(resolvedUrl);\n }\n}\n"]}
1
+ {"version":3,"file":"testObjectProvider.js","sourceRoot":"","sources":["../src/testObjectProvider.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,uEAAmH;AAInH,+DAAsE;AAEtE,+BAAkC;AAClC,qEAA+E;AAC/E,qEAAkE;AAClE,uDAAqE;AACrE,+CAAyD;AAGzD,MAAM,kBAAkB,GAAsB;IAC1C,OAAO,EAAE,oBAAoB;IAC7B,MAAM,EAAE,EAAE;CACb,CAAC;AAiDF,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC7B,qEAAM,CAAA;IACN,iEAAI,CAAA;AACR,CAAC,EAHW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAGhC;AAqBM,MAAM,gBAAgB,GAAG,GAAW,EAAE,CAAC,SAAI,EAAE,CAAC;AAAxC,QAAA,gBAAgB,oBAAwB;AAQrD;;;GAGG;AACH,SAAS,qBAAqB,CAAC,IAAsB;IACjD,IAAI,UAAU,GAAG,wBAAgB,EAAE,CAAC;IACpC,QAAQ,IAAI,EAAE;QACV,KAAK,MAAM;YACP,OAAO;gBACH,GAAG,EAAE,GAAG,EAAE,CAAC,UAAU;gBACrB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC;gBACjB,KAAK,EAAE,GAAG,EAAE,CAAC,UAAU,GAAG,wBAAgB,EAAE;aA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,CAC1B,kBAAkB,EAClB,MAAM,EACN,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAC7D,4DAA4D;QAC5D,uEAAuE;QACvE,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACvD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,iBAAiB,CAAC,mBAA0C;QACrE,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;QACxD,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QACvG,MAAM,yCAAsB,CAAC,SAAS,CAAC,CAAC;QACxC,OAAO,SAAS,CAAC;IACrB,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;QACrC,IAAI,CAAC,uBAAuB,GAAG,SAAS,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC7B,CAAC;IAEM,KAAK,CAAC,kBAAkB;QAC3B,OAAO,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,EAAE,CAAC;IAC7D,CAAC;IAED,gBAAgB,CAAC,WAAqC;QAClD,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;CACJ;AAnLD,gDAmLC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainer, IHostLoader, ILoaderOptions } from \"@fluidframework/container-definitions\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport { Container, IDetachedBlobStorage, Loader, waitContainerToCatchUp } from \"@fluidframework/container-loader\";\nimport { IContainerRuntimeOptions } from \"@fluidframework/container-runtime\";\nimport { IFluidCodeDetails, IRequestHeader } from \"@fluidframework/core-interfaces\";\nimport { IDocumentServiceFactory, IResolvedUrl, IUrlResolver } from \"@fluidframework/driver-definitions\";\nimport { ensureFluidResolvedUrl } from \"@fluidframework/driver-utils\";\nimport { ITestDriver, TestDriverTypes } from \"@fluidframework/test-driver-definitions\";\nimport { v4 as uuid } from \"uuid\";\nimport { ChildLogger, MultiSinkLogger } from \"@fluidframework/telemetry-utils\";\nimport { LoaderContainerTracker } from \"./loaderContainerTracker\";\nimport { fluidEntryPoint, LocalCodeLoader } from \"./localCodeLoader\";\nimport { createAndAttachContainer } from \"./localLoader\";\nimport { ChannelFactoryRegistry } from \"./testFluidObject\";\n\nconst defaultCodeDetails: IFluidCodeDetails = {\n package: \"defaultTestPackage\",\n config: {},\n};\n\nexport interface IOpProcessingController {\n processIncoming(...containers: IContainer[]): Promise<void>;\n processOutgoing(...containers: IContainer[]): Promise<void>;\n pauseProcessing(...containers: IContainer[]): Promise<void>;\n resumeProcessing(...containers: IContainer[]): void;\n}\n\nexport interface ITestObjectProvider {\n createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint;\n createLoader(\n packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,\n options?: ITestLoaderOptions,\n detachedBlobStorage?: IDetachedBlobStorage,\n ): IHostLoader;\n createContainer(entryPoint: fluidEntryPoint, options?: ITestLoaderOptions): Promise<IContainer>;\n loadContainer(\n entryPoint: fluidEntryPoint,\n options?: ITestLoaderOptions,\n requestHeader?: IRequestHeader,\n ): Promise<IContainer>;\n\n /**\n * Used to create a test Container. The Loader/ContainerRuntime/DataRuntime might be different versioned.\n * In generateLocalCompatTest(), this Container and its runtime will be arbitrarily-versioned.\n */\n makeTestLoader(testContainerConfig?: ITestContainerConfig, detachedBlobStorage?: IDetachedBlobStorage): IHostLoader,\n makeTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer>,\n loadTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer>,\n /**\n *\n * @param url - Resolved container URL\n */\n updateDocumentId(url: IResolvedUrl | undefined): void,\n\n logger: ITelemetryBaseLogger,\n documentServiceFactory: IDocumentServiceFactory,\n urlResolver: IUrlResolver,\n defaultCodeDetails: IFluidCodeDetails,\n opProcessingController: IOpProcessingController,\n\n ensureSynchronized(): Promise<void>;\n reset(): void,\n\n documentId: string,\n driver: ITestDriver;\n}\n\nexport enum DataObjectFactoryType {\n Primed, // default\n Test,\n}\n\nexport interface ITestContainerConfig {\n /** TestFluidDataObject instead of PrimedDataStore */\n fluidDataObjectType?: DataObjectFactoryType,\n\n /** An array of channel name and DDS factory pair to create on container creation time */\n registry?: ChannelFactoryRegistry,\n\n /** Container runtime options for the container instance */\n runtimeOptions?: IContainerRuntimeOptions,\n\n /** Loader options for the loader used to create containers */\n loaderOptions?: ITestLoaderOptions,\n}\n\n// new interface to help inject custom loggers to tests\nexport interface ITestLoaderOptions extends ILoaderOptions {\n logger?: ITelemetryBaseLogger;\n}\n\nexport const createDocumentId = (): string => uuid();\n\ninterface IDocumentIdStrategy {\n get(): string;\n update(resolvedUrl?: IResolvedUrl): void;\n reset(): void;\n}\n\n/**\n * Document ID is treated differently by test drivers. The key difference is in generating\n * a new container ID and accessing the container in multi-instance test cases.\n */\nfunction getDocumentIdStrategy(type?: TestDriverTypes): IDocumentIdStrategy {\n let documentId = createDocumentId();\n switch (type) {\n case \"odsp\":\n return {\n get: () => documentId,\n update: () => { }, // do not update the document ID in odsp test cases\n reset: () => documentId = createDocumentId(),\n };\n default:\n return {\n get: () => documentId,\n update: (resolvedUrl?: IResolvedUrl) => {\n // Extract the document ID from the resolved container's URL and reset the ID property\n ensureFluidResolvedUrl(resolvedUrl);\n documentId = resolvedUrl.id ?? documentId;\n },\n reset: () => documentId = createDocumentId(),\n };\n }\n}\n\n/**\n * Shared base class for test object provider. Contain code for loader and container creation and loading\n */\nexport class TestObjectProvider {\n private readonly _loaderContainerTracker = new LoaderContainerTracker();\n private _documentServiceFactory: IDocumentServiceFactory | undefined;\n private _urlResolver: IUrlResolver | undefined;\n private _logger: ITelemetryBaseLogger | undefined;\n private readonly _documentIdStrategy: IDocumentIdStrategy;\n\n /**\n * Manage objects for loading and creating container, including the driver, loader, and OpProcessingController\n * @param createFluidEntryPoint - callback to create a fluidEntryPoint, with an optional set of channel name\n * and factory for TestFluidObject\n */\n constructor(\n public readonly LoaderConstructor: typeof Loader,\n public readonly driver: ITestDriver,\n public readonly createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint,\n ) {\n this._documentIdStrategy = getDocumentIdStrategy(driver.type);\n }\n\n get logger() {\n if (this._logger === undefined) {\n this._logger = ChildLogger.create(getTestLogger?.(), undefined,\n {\n all: {\n driverType: this.driver.type,\n driverEndpointName: this.driver.endpointName,\n driverTenantName: this.driver.tenantName,\n driverUserIndex: this.driver.userIndex,\n },\n });\n }\n return this._logger;\n }\n\n get documentServiceFactory() {\n if (!this._documentServiceFactory) {\n this._documentServiceFactory = this.driver.createDocumentServiceFactory();\n }\n return this._documentServiceFactory;\n }\n\n get urlResolver() {\n if (!this._urlResolver) {\n this._urlResolver = this.driver.createUrlResolver();\n }\n return this._urlResolver;\n }\n\n get documentId() {\n return this._documentIdStrategy.get();\n }\n\n get defaultCodeDetails() {\n return defaultCodeDetails;\n }\n\n get opProcessingController(): IOpProcessingController {\n return this._loaderContainerTracker;\n }\n\n /**\n * Create a loader. Containers created/loaded through this loader will be added to the OpProcessingController.\n *\n * Only the version of the loader will vary based on compat config. The version of\n * containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.\n *\n * @param packageEntries - list of code details and fluidEntryPoint pairs.\n */\n public createLoader(\n packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,\n options?: ITestLoaderOptions,\n detachedBlobStorage?: IDetachedBlobStorage,\n ) {\n const multiSinkLogger = new MultiSinkLogger();\n multiSinkLogger.addLogger(this.logger);\n if (options?.logger !== undefined) {\n multiSinkLogger.addLogger(options.logger);\n }\n\n const codeLoader = new LocalCodeLoader(packageEntries);\n const loader = new this.LoaderConstructor({\n urlResolver: this.urlResolver,\n documentServiceFactory: this.documentServiceFactory,\n codeLoader,\n logger: multiSinkLogger,\n options,\n detachedBlobStorage,\n });\n this._loaderContainerTracker.add(loader);\n return loader;\n }\n\n /**\n * Create a container using a default document id and code details.\n * Container created is automatically added to the OpProcessingController to manage op flow\n *\n * Only the version of the loader will vary based on compat config. The version of\n * containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.\n *\n * @param packageEntries - list of code details and fluidEntryPoint pairs.\n */\n public async createContainer(entryPoint: fluidEntryPoint, options?: ITestLoaderOptions) {\n const loader = this.createLoader([[defaultCodeDetails, entryPoint]], options);\n const container = await createAndAttachContainer(\n defaultCodeDetails,\n loader,\n this.driver.createCreateNewRequest(this.documentId),\n );\n // r11s driver will generate a new ID for the new container.\n // update the document ID with the actual ID of the attached container.\n this._documentIdStrategy.update(container.resolvedUrl);\n return container;\n }\n\n public async loadContainer(entryPoint: fluidEntryPoint, options?: ITestLoaderOptions,\n requestHeader?: IRequestHeader) {\n const loader = this.createLoader([[defaultCodeDetails, entryPoint]], options);\n return loader.resolve({ url: await this.driver.createContainerUrl(this.documentId), headers: requestHeader });\n }\n\n /**\n * Make a test loader. Containers created/loaded through this loader will be added to the OpProcessingController.\n * The version of the loader/containerRuntime/dataRuntime may vary based on compat config of the current run\n * @param testContainerConfig - optional configuring the test Container\n */\n public makeTestLoader(testContainerConfig?: ITestContainerConfig, detachedBlobStorage?: IDetachedBlobStorage) {\n return this.createLoader(\n [[defaultCodeDetails, this.createFluidEntryPoint(testContainerConfig)]],\n testContainerConfig?.loaderOptions,\n detachedBlobStorage,\n );\n }\n\n /**\n * Make a container using a default document id and code details\n * Container loaded is automatically added to the OpProcessingController to manage op flow\n * @param testContainerConfig - optional configuring the test Container\n */\n public async makeTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer> {\n const loader = this.makeTestLoader(testContainerConfig);\n const container =\n await createAndAttachContainer(\n defaultCodeDetails,\n loader,\n this.driver.createCreateNewRequest(this.documentId));\n // r11s driver will generate a new ID for the new container.\n // update the document ID with the actual ID of the attached container.\n this._documentIdStrategy.update(container.resolvedUrl);\n return container;\n }\n\n /**\n * Load a container using a default document id and code details.\n * Container loaded is automatically added to the OpProcessingController to manage op flow\n * @param testContainerConfig - optional configuring the test Container\n */\n public async loadTestContainer(testContainerConfig?: ITestContainerConfig): Promise<Container> {\n const loader = this.makeTestLoader(testContainerConfig);\n const container = await loader.resolve({ url: await this.driver.createContainerUrl(this.documentId) });\n await waitContainerToCatchUp(container);\n return container;\n }\n\n public reset() {\n this._loaderContainerTracker.reset();\n this._documentServiceFactory = undefined;\n this._urlResolver = undefined;\n this._documentIdStrategy.reset();\n this._logger = undefined;\n }\n\n public async ensureSynchronized() {\n return this._loaderContainerTracker.ensureSynchronized();\n }\n\n updateDocumentId(resolvedUrl: IResolvedUrl | undefined) {\n this._documentIdStrategy.update(resolvedUrl);\n }\n}\n"]}
@@ -11,7 +11,8 @@ export interface TimeoutWithError {
11
11
  export interface TimeoutWithValue<T = void> {
12
12
  durationMs?: number;
13
13
  reject: false;
14
- value?: T;
14
+ value: T;
15
15
  }
16
- export declare function timeoutPromise<T = void>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void, timeoutOptions?: TimeoutWithError | TimeoutWithValue<T>): Promise<T | void>;
16
+ export declare function timeoutAwait<T = void>(promise: PromiseLike<T>, timeoutOptions?: TimeoutWithError | TimeoutWithValue<T>): Promise<T>;
17
+ export declare function timeoutPromise<T = void>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void, timeoutOptions?: TimeoutWithError | TimeoutWithValue<T>): Promise<T>;
17
18
  //# sourceMappingURL=timeoutUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"timeoutUtils.d.ts","sourceRoot":"","sources":["../src/timeoutUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,IAAI;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC;IACd,KAAK,CAAC,EAAE,CAAC,CAAC;CACZ;AAED,wBAAsB,cAAc,CAAC,CAAC,GAAG,IAAI,EAC1C,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,EAChG,cAAc,GAAE,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAM,GAC5D,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAqBnB"}
1
+ {"version":3,"file":"timeoutUtils.d.ts","sourceRoot":"","sources":["../src/timeoutUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,IAAI;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;CACX;AAGF,wBAAsB,YAAY,CAAC,CAAC,GAAG,IAAI,EACvC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,EACvB,cAAc,GAAE,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAM,cAG9D;AAEA,wBAAsB,cAAc,CAAC,CAAC,GAAG,IAAI,EAC1C,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,KAAK,IAAI,EAChG,cAAc,GAAE,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAM,GAC5D,OAAO,CAAC,CAAC,CAAC,CAqBZ"}
@@ -4,8 +4,13 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.timeoutPromise = exports.defaultTimeoutDurationMs = void 0;
7
+ exports.timeoutPromise = exports.timeoutAwait = exports.defaultTimeoutDurationMs = void 0;
8
8
  exports.defaultTimeoutDurationMs = 250;
9
+ // eslint-disable-next-line prefer-arrow/prefer-arrow-functions
10
+ async function timeoutAwait(promise, timeoutOptions = {}) {
11
+ return Promise.race([promise, timeoutPromise(() => { }, timeoutOptions)]);
12
+ }
13
+ exports.timeoutAwait = timeoutAwait;
9
14
  async function timeoutPromise(executor, timeoutOptions = {}) {
10
15
  var _a;
11
16
  // create the timeout error outside the async task, so it's callstack includes
@@ -1 +1 @@
1
- {"version":3,"file":"timeoutUtils.js","sourceRoot":"","sources":["../src/timeoutUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,wBAAwB,GAAG,GAAG,CAAC;AAapC,KAAK,UAAU,cAAc,CACjC,QAAgG,EAChG,iBAAyD,EAAE;;IAE3D,8EAA8E;IAC9E,wDAAwD;IACxD,MAAM,GAAG,GAAG,cAAc,CAAC,MAAM,KAAK,KAAK;QACvC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAI,KAAK,OAAC,cAAc,CAAC,QAAQ,mCAAI,SAAS,CAAC,CAAC;IACtD,OAAO,IAAI,OAAO,CAAW,CAAC,GAAG,EAAC,GAAG,EAAC,EAAE;;QACpC,MAAM,OAAO,GAAG,UAAU,CACtB,GAAE,EAAE,CAAA,cAAc,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,QAC1E,cAAc,CAAC,UAAU,mCAAI,gCAAwB,CAAC,CAAC;QAE3D,QAAQ,CACJ,CAAC,KAAK,EAAE,EAAE;YACN,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,GAAG,CAAC,KAAK,CAAC,CAAC;QACf,CAAC,EACD,CAAC,MAAM,EAAE,EAAE;YACP,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,GAAG,CAAC,MAAM,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACP,CAAC;AAxBA,wCAwBA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport const defaultTimeoutDurationMs = 250;\n\n export interface TimeoutWithError{\n durationMs?: number;\n reject?: true;\n errorMsg?: string;\n }\n export interface TimeoutWithValue<T = void>{\n durationMs?: number;\n reject: false;\n value?: T;\n }\n\n export async function timeoutPromise<T = void>(\n executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void,\n timeoutOptions: TimeoutWithError | TimeoutWithValue<T> = {},\n): Promise<T | void> {\n // create the timeout error outside the async task, so it's callstack includes\n // the original call site, this makes it easier to debug\n const err = timeoutOptions.reject === false\n ? undefined\n : new Error(timeoutOptions.errorMsg ?? \"Timeout\");\n return new Promise<T | void>((res,rej)=>{\n const timeout = setTimeout(\n ()=>timeoutOptions.reject === false ? res(timeoutOptions.value) : rej(err),\n timeoutOptions.durationMs ?? defaultTimeoutDurationMs);\n\n executor(\n (value) => {\n clearTimeout(timeout);\n res(value);\n },\n (reason) => {\n clearTimeout(timeout);\n rej(reason);\n });\n });\n}\n"]}
1
+ {"version":3,"file":"timeoutUtils.js","sourceRoot":"","sources":["../src/timeoutUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,wBAAwB,GAAG,GAAG,CAAC;AAa5C,+DAA+D;AACxD,KAAK,UAAU,YAAY,CAC9B,OAAuB,EACvB,iBAAyD,EAAE;IAE3D,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,CAAI,GAAE,EAAE,GAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC;AALD,oCAKC;AAEO,KAAK,UAAU,cAAc,CACjC,QAAgG,EAChG,iBAAyD,EAAE;;IAE3D,8EAA8E;IAC9E,wDAAwD;IACxD,MAAM,GAAG,GAAG,cAAc,CAAC,MAAM,KAAK,KAAK;QACvC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAI,KAAK,OAAC,cAAc,CAAC,QAAQ,mCAAI,SAAS,CAAC,CAAC;IACtD,OAAO,IAAI,OAAO,CAAI,CAAC,GAAG,EAAC,GAAG,EAAC,EAAE;;QAC7B,MAAM,OAAO,GAAG,UAAU,CACtB,GAAE,EAAE,CAAA,cAAc,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,QAC1E,cAAc,CAAC,UAAU,mCAAI,gCAAwB,CAAC,CAAC;QAE3D,QAAQ,CACJ,CAAC,KAAK,EAAE,EAAE;YACN,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,GAAG,CAAC,KAAK,CAAC,CAAC;QACf,CAAC,EACD,CAAC,MAAM,EAAE,EAAE;YACP,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,GAAG,CAAC,MAAM,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACP,CAAC;AAxBA,wCAwBA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport const defaultTimeoutDurationMs = 250;\n\n export interface TimeoutWithError{\n durationMs?: number;\n reject?: true;\n errorMsg?: string;\n }\n export interface TimeoutWithValue<T = void>{\n durationMs?: number;\n reject: false;\n value: T;\n }\n\n// eslint-disable-next-line prefer-arrow/prefer-arrow-functions\nexport async function timeoutAwait<T = void>(\n promise: PromiseLike<T>,\n timeoutOptions: TimeoutWithError | TimeoutWithValue<T> = {},\n) {\n return Promise.race([promise, timeoutPromise<T>(()=>{}, timeoutOptions)]);\n}\n\n export async function timeoutPromise<T = void>(\n executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void,\n timeoutOptions: TimeoutWithError | TimeoutWithValue<T> = {},\n): Promise<T> {\n // create the timeout error outside the async task, so it's callstack includes\n // the original call site, this makes it easier to debug\n const err = timeoutOptions.reject === false\n ? undefined\n : new Error(timeoutOptions.errorMsg ?? \"Timeout\");\n return new Promise<T>((res,rej)=>{\n const timeout = setTimeout(\n ()=>timeoutOptions.reject === false ? res(timeoutOptions.value) : rej(err),\n timeoutOptions.durationMs ?? defaultTimeoutDurationMs);\n\n executor(\n (value) => {\n clearTimeout(timeout);\n res(value);\n },\n (reason) => {\n clearTimeout(timeout);\n rej(reason);\n });\n });\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/test-utils",
3
- "version": "0.50.1",
3
+ "version": "0.51.1",
4
4
  "description": "Utilities for Fluid tests",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": "https://github.com/microsoft/FluidFramework",
@@ -49,33 +49,33 @@
49
49
  "temp-directory": "nyc/.nyc_output"
50
50
  },
51
51
  "dependencies": {
52
- "@fluidframework/aqueduct": "^0.50.1",
52
+ "@fluidframework/aqueduct": "^0.51.1",
53
53
  "@fluidframework/common-definitions": "^0.20.1",
54
54
  "@fluidframework/container-definitions": "^0.41.0",
55
- "@fluidframework/container-loader": "^0.50.1",
56
- "@fluidframework/container-runtime": "^0.50.1",
57
- "@fluidframework/container-runtime-definitions": "^0.50.1",
55
+ "@fluidframework/container-loader": "^0.51.1",
56
+ "@fluidframework/container-runtime": "^0.51.1",
57
+ "@fluidframework/container-runtime-definitions": "^0.51.1",
58
58
  "@fluidframework/core-interfaces": "^0.40.0",
59
- "@fluidframework/datastore": "^0.50.1",
60
- "@fluidframework/datastore-definitions": "^0.50.1",
59
+ "@fluidframework/datastore": "^0.51.1",
60
+ "@fluidframework/datastore-definitions": "^0.51.1",
61
61
  "@fluidframework/driver-definitions": "^0.41.0",
62
- "@fluidframework/driver-utils": "^0.50.1",
63
- "@fluidframework/local-driver": "^0.50.1",
64
- "@fluidframework/map": "^0.50.1",
62
+ "@fluidframework/driver-utils": "^0.51.1",
63
+ "@fluidframework/local-driver": "^0.51.1",
64
+ "@fluidframework/map": "^0.51.1",
65
65
  "@fluidframework/protocol-definitions": "^0.1025.0",
66
- "@fluidframework/request-handler": "^0.50.1",
67
- "@fluidframework/routerlicious-driver": "^0.50.1",
68
- "@fluidframework/runtime-definitions": "^0.50.1",
69
- "@fluidframework/runtime-utils": "^0.50.1",
70
- "@fluidframework/telemetry-utils": "^0.50.1",
71
- "@fluidframework/test-driver-definitions": "^0.50.1",
72
- "@fluidframework/test-runtime-utils": "^0.50.1",
66
+ "@fluidframework/request-handler": "^0.51.1",
67
+ "@fluidframework/routerlicious-driver": "^0.51.1",
68
+ "@fluidframework/runtime-definitions": "^0.51.1",
69
+ "@fluidframework/runtime-utils": "^0.51.1",
70
+ "@fluidframework/telemetry-utils": "^0.51.1",
71
+ "@fluidframework/test-driver-definitions": "^0.51.1",
72
+ "@fluidframework/test-runtime-utils": "^0.51.1",
73
73
  "debug": "^4.1.1",
74
74
  "uuid": "^8.3.1"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@fluidframework/build-common": "^0.23.0",
78
- "@fluidframework/eslint-config-fluid": "^0.23.0",
78
+ "@fluidframework/eslint-config-fluid": "^0.24.0",
79
79
  "@microsoft/api-extractor": "^7.16.1",
80
80
  "@types/diff": "^3.5.1",
81
81
  "@types/mocha": "^8.2.2",
@@ -83,7 +83,7 @@
83
83
  "@types/random-js": "^1.0.31",
84
84
  "@typescript-eslint/eslint-plugin": "~4.14.0",
85
85
  "@typescript-eslint/parser": "~4.14.0",
86
- "concurrently": "^5.2.0",
86
+ "concurrently": "^6.2.0",
87
87
  "copyfiles": "^2.1.0",
88
88
  "diff": "^3.5.0",
89
89
  "eslint": "~7.18.0",
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/test-utils";
9
- export const pkgVersion = "0.50.1";
9
+ export const pkgVersion = "0.51.1";
@@ -31,6 +31,7 @@ export interface IOpProcessingController {
31
31
  }
32
32
 
33
33
  export interface ITestObjectProvider {
34
+ createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint;
34
35
  createLoader(
35
36
  packageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,
36
37
  options?: ITestLoaderOptions,
@@ -145,7 +146,7 @@ export class TestObjectProvider {
145
146
  constructor(
146
147
  public readonly LoaderConstructor: typeof Loader,
147
148
  public readonly driver: ITestDriver,
148
- private readonly createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint,
149
+ public readonly createFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint,
149
150
  ) {
150
151
  this._documentIdStrategy = getDocumentIdStrategy(driver.type);
151
152
  }
@@ -13,19 +13,27 @@ export const defaultTimeoutDurationMs = 250;
13
13
  export interface TimeoutWithValue<T = void>{
14
14
  durationMs?: number;
15
15
  reject: false;
16
- value?: T;
16
+ value: T;
17
17
  }
18
18
 
19
+ // eslint-disable-next-line prefer-arrow/prefer-arrow-functions
20
+ export async function timeoutAwait<T = void>(
21
+ promise: PromiseLike<T>,
22
+ timeoutOptions: TimeoutWithError | TimeoutWithValue<T> = {},
23
+ ) {
24
+ return Promise.race([promise, timeoutPromise<T>(()=>{}, timeoutOptions)]);
25
+ }
26
+
19
27
  export async function timeoutPromise<T = void>(
20
28
  executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void,
21
29
  timeoutOptions: TimeoutWithError | TimeoutWithValue<T> = {},
22
- ): Promise<T | void> {
30
+ ): Promise<T> {
23
31
  // create the timeout error outside the async task, so it's callstack includes
24
32
  // the original call site, this makes it easier to debug
25
33
  const err = timeoutOptions.reject === false
26
34
  ? undefined
27
35
  : new Error(timeoutOptions.errorMsg ?? "Timeout");
28
- return new Promise<T | void>((res,rej)=>{
36
+ return new Promise<T>((res,rej)=>{
29
37
  const timeout = setTimeout(
30
38
  ()=>timeoutOptions.reject === false ? res(timeoutOptions.value) : rej(err),
31
39
  timeoutOptions.durationMs ?? defaultTimeoutDurationMs);