@fluidframework/test-utils 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.245554

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.
Files changed (146) hide show
  1. package/.eslintrc.cjs +4 -1
  2. package/{.mocharc.js → .mocharc.cjs} +1 -1
  3. package/CHANGELOG.md +34 -0
  4. package/README.md +1 -1
  5. package/api-extractor-cjs.json +8 -0
  6. package/api-extractor-lint.json +1 -1
  7. package/api-extractor.json +1 -1
  8. package/api-report/test-utils.api.md +18 -6
  9. package/dist/DriverWrappers.d.ts +3 -0
  10. package/dist/DriverWrappers.d.ts.map +1 -1
  11. package/dist/DriverWrappers.js +3 -0
  12. package/dist/DriverWrappers.js.map +1 -1
  13. package/dist/TestSummaryUtils.d.ts +7 -2
  14. package/dist/TestSummaryUtils.d.ts.map +1 -1
  15. package/dist/TestSummaryUtils.js +14 -12
  16. package/dist/TestSummaryUtils.js.map +1 -1
  17. package/dist/containerUtils.d.ts +1 -1
  18. package/dist/containerUtils.d.ts.map +1 -1
  19. package/dist/containerUtils.js +2 -2
  20. package/dist/containerUtils.js.map +1 -1
  21. package/dist/debug.js +2 -2
  22. package/dist/debug.js.map +1 -1
  23. package/dist/index.d.ts +14 -14
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +44 -43
  26. package/dist/index.js.map +1 -1
  27. package/dist/loaderContainerTracker.d.ts +1 -1
  28. package/dist/loaderContainerTracker.d.ts.map +1 -1
  29. package/dist/loaderContainerTracker.js +11 -11
  30. package/dist/loaderContainerTracker.js.map +1 -1
  31. package/dist/localLoader.d.ts +1 -1
  32. package/dist/localLoader.d.ts.map +1 -1
  33. package/dist/localLoader.js +2 -2
  34. package/dist/localLoader.js.map +1 -1
  35. package/dist/package.json +3 -0
  36. package/dist/packageVersion.d.ts +1 -1
  37. package/dist/packageVersion.js +1 -1
  38. package/dist/packageVersion.js.map +1 -1
  39. package/dist/test-utils-alpha.d.ts +3 -1
  40. package/dist/test-utils-beta.d.ts +5 -1
  41. package/dist/test-utils-public.d.ts +5 -1
  42. package/dist/test-utils-untrimmed.d.ts +40 -9
  43. package/dist/testContainerRuntimeFactory.d.ts.map +1 -1
  44. package/dist/testContainerRuntimeFactory.js +9 -2
  45. package/dist/testContainerRuntimeFactory.js.map +1 -1
  46. package/dist/testFluidObject.d.ts +1 -1
  47. package/dist/testFluidObject.d.ts.map +1 -1
  48. package/dist/testFluidObject.js.map +1 -1
  49. package/dist/testObjectProvider.d.ts +34 -11
  50. package/dist/testObjectProvider.d.ts.map +1 -1
  51. package/dist/testObjectProvider.js +71 -38
  52. package/dist/testObjectProvider.js.map +1 -1
  53. package/dist/timeoutUtils.d.ts.map +1 -1
  54. package/dist/timeoutUtils.js.map +1 -1
  55. package/dist/tsdoc-metadata.json +1 -1
  56. package/lib/DriverWrappers.d.ts +35 -0
  57. package/lib/DriverWrappers.d.ts.map +1 -0
  58. package/lib/DriverWrappers.js +54 -0
  59. package/lib/DriverWrappers.js.map +1 -0
  60. package/lib/TestConfigs.d.ts +23 -0
  61. package/lib/TestConfigs.d.ts.map +1 -0
  62. package/lib/TestConfigs.js +24 -0
  63. package/lib/TestConfigs.js.map +1 -0
  64. package/lib/TestSummaryUtils.d.ts +66 -0
  65. package/lib/TestSummaryUtils.d.ts.map +1 -0
  66. package/lib/TestSummaryUtils.js +153 -0
  67. package/lib/TestSummaryUtils.js.map +1 -0
  68. package/lib/containerUtils.d.ts +46 -0
  69. package/lib/containerUtils.d.ts.map +1 -0
  70. package/lib/containerUtils.js +79 -0
  71. package/lib/containerUtils.js.map +1 -0
  72. package/lib/debug.d.ts +7 -0
  73. package/lib/debug.d.ts.map +1 -0
  74. package/lib/debug.js +9 -0
  75. package/lib/debug.js.map +1 -0
  76. package/lib/index.d.ts +19 -0
  77. package/lib/index.d.ts.map +1 -0
  78. package/lib/index.js +18 -0
  79. package/lib/index.js.map +1 -0
  80. package/lib/interfaces.d.ts +25 -0
  81. package/lib/interfaces.d.ts.map +1 -0
  82. package/lib/interfaces.js +6 -0
  83. package/lib/interfaces.js.map +1 -0
  84. package/lib/loaderContainerTracker.d.ts +144 -0
  85. package/lib/loaderContainerTracker.d.ts.map +1 -0
  86. package/lib/loaderContainerTracker.js +631 -0
  87. package/lib/loaderContainerTracker.js.map +1 -0
  88. package/lib/localCodeLoader.d.ts +31 -0
  89. package/lib/localCodeLoader.d.ts.map +1 -0
  90. package/lib/localCodeLoader.js +73 -0
  91. package/lib/localCodeLoader.js.map +1 -0
  92. package/lib/localLoader.d.ts +26 -0
  93. package/lib/localLoader.d.ts.map +1 -0
  94. package/lib/localLoader.js +37 -0
  95. package/lib/localLoader.js.map +1 -0
  96. package/lib/packageVersion.d.ts +9 -0
  97. package/lib/packageVersion.d.ts.map +1 -0
  98. package/lib/packageVersion.js +9 -0
  99. package/lib/packageVersion.js.map +1 -0
  100. package/lib/retry.d.ts +18 -0
  101. package/lib/retry.d.ts.map +1 -0
  102. package/lib/retry.js +37 -0
  103. package/lib/retry.js.map +1 -0
  104. package/lib/test/timeoutUtils.spec.js +165 -0
  105. package/lib/test/timeoutUtils.spec.js.map +1 -0
  106. package/lib/test/types/validateTestUtilsPrevious.generated.js +90 -0
  107. package/lib/test/types/validateTestUtilsPrevious.generated.js.map +1 -0
  108. package/lib/test-utils-alpha.d.ts +309 -0
  109. package/lib/test-utils-beta.d.ts +208 -0
  110. package/lib/test-utils-public.d.ts +208 -0
  111. package/lib/test-utils-untrimmed.d.ts +1046 -0
  112. package/lib/testContainerRuntimeFactory.d.ts +46 -0
  113. package/lib/testContainerRuntimeFactory.d.ts.map +1 -0
  114. package/lib/testContainerRuntimeFactory.js +113 -0
  115. package/lib/testContainerRuntimeFactory.js.map +1 -0
  116. package/lib/testContainerRuntimeFactoryWithDefaultDataStore.d.ts +23 -0
  117. package/lib/testContainerRuntimeFactoryWithDefaultDataStore.d.ts.map +1 -0
  118. package/lib/testContainerRuntimeFactoryWithDefaultDataStore.js +28 -0
  119. package/lib/testContainerRuntimeFactoryWithDefaultDataStore.js.map +1 -0
  120. package/lib/testFluidObject.d.ts +92 -0
  121. package/lib/testFluidObject.d.ts.map +1 -0
  122. package/lib/testFluidObject.js +159 -0
  123. package/lib/testFluidObject.js.map +1 -0
  124. package/lib/testObjectProvider.d.ts +435 -0
  125. package/lib/testObjectProvider.d.ts.map +1 -0
  126. package/lib/testObjectProvider.js +636 -0
  127. package/lib/testObjectProvider.js.map +1 -0
  128. package/lib/timeoutUtils.d.ts +60 -0
  129. package/lib/timeoutUtils.d.ts.map +1 -0
  130. package/lib/timeoutUtils.js +164 -0
  131. package/lib/timeoutUtils.js.map +1 -0
  132. package/package.json +99 -37
  133. package/src/DriverWrappers.ts +3 -0
  134. package/src/TestSummaryUtils.ts +7 -6
  135. package/src/containerUtils.ts +1 -1
  136. package/src/debug.ts +1 -1
  137. package/src/index.ts +19 -14
  138. package/src/loaderContainerTracker.ts +5 -5
  139. package/src/localLoader.ts +1 -1
  140. package/src/packageVersion.ts +1 -1
  141. package/src/testContainerRuntimeFactory.ts +12 -2
  142. package/src/testFluidObject.ts +1 -1
  143. package/src/testObjectProvider.ts +99 -34
  144. package/src/timeoutUtils.ts +1 -0
  145. package/tsconfig.cjs.json +7 -0
  146. package/tsconfig.json +3 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testObjectProvider.js","sourceRoot":"","sources":["../src/testObjectProvider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAGN,sBAAsB,IAAI,+BAA+B,GACzD,MAAM,kCAAkC,CAAC;AAa1C,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EACN,iBAAiB,EACjB,qBAAqB,GAErB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAmB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EA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G,IAAI,sBAAsB,CAAC,qBAAqB,CAAC,CAAC;IAClF,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,8BAA8B,CAC7C,MAA+C,EAC/C,MAAe;IAEf,IAAI,MAAM,KAAK,SAAS,EAAE;QACzB,OAAO;KACP;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,2BAA2B,EAAE,CAAC;IACrD,IAAI,OAAO,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;QACxC,OAAO,IAAI,KAAK,CACf,GAAG,MAAM,IAAI,EAAE,+BAA+B,IAAI,CAAC,SAAS,CAC3D,OAAO,CAAC,gBAAgB,EACxB,SAAS,EACT,CAAC,CACD,EAAE,CACH,CAAC;KACF;IACD,IAAI,OAAO,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;QACxC,OAAO,IAAI,KAAK,CACf,GAAG,MAAM,IAAI,EAAE,+BAA+B,IAAI,CAAC,SAAS,CAC3D,OAAO,CAAC,gBAAgB,EACxB,SAAS,EACT,CAAC,CACD,EAAE,CACH,CAAC;KACF;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIContainer,\n\tIHostLoader,\n\tIFluidCodeDetails,\n\tILoader,\n} from \"@fluidframework/container-definitions\";\nimport {\n\tILoaderProps,\n\tLoader,\n\twaitContainerToCatchUp as waitContainerToCatchUp_original,\n} from \"@fluidframework/container-loader\";\nimport { IContainerRuntimeOptions } from \"@fluidframework/container-runtime\";\nimport {\n\tITelemetryBaseLogger,\n\tITelemetryBaseEvent,\n\tIRequestHeader,\n} from \"@fluidframework/core-interfaces\";\nimport {\n\tIDocumentServiceFactory,\n\tIResolvedUrl,\n\tIUrlResolver,\n} from \"@fluidframework/driver-definitions\";\nimport { ITestDriver, TestDriverTypes } from \"@fluidframework/test-driver-definitions\";\nimport { v4 as uuid } from \"uuid\";\nimport {\n\tcreateChildLogger,\n\tcreateMultiSinkLogger,\n\ttype ITelemetryGenericEventExt,\n} from \"@fluidframework/telemetry-utils\";\nimport { LoaderContainerTracker } from \"./loaderContainerTracker.js\";\nimport { fluidEntryPoint, LocalCodeLoader } from \"./localCodeLoader.js\";\nimport { createAndAttachContainer } from \"./localLoader.js\";\nimport { ChannelFactoryRegistry } from \"./testFluidObject.js\";\n\nconst defaultCodeDetails: IFluidCodeDetails = {\n\tpackage: \"defaultTestPackage\",\n\tconfig: {},\n};\n\n/**\n * @alpha\n */\nexport interface IOpProcessingController {\n\tprocessIncoming(...containers: IContainer[]): Promise<void>;\n\tprocessOutgoing(...containers: IContainer[]): Promise<void>;\n\tpauseProcessing(...containers: IContainer[]): Promise<void>;\n\tresumeProcessing(...containers: IContainer[]): void;\n}\n\n/**\n * @internal\n */\nexport interface ITestObjectProvider {\n\t/**\n\t * Indicates which type of test object provider is being used.\n\t */\n\ttype: \"TestObjectProvider\" | \"TestObjectProviderWithVersionedLoad\";\n\n\t/**\n\t * The document id to retrieve or create containers\n\t */\n\tdocumentId: string;\n\n\t/**\n\t * Creates the document service after extracting different endpoints URLs from a resolved URL.\n\t */\n\tdocumentServiceFactory: IDocumentServiceFactory;\n\n\t/**\n\t * Test driver used to create the IDocumentServiceFactory. Varies depending on the test type.\n\t */\n\tdriver: ITestDriver;\n\n\t/**\n\t * Logger used to track expected and unexpected events.\n\t */\n\tlogger: EventAndErrorTrackingLogger | undefined;\n\n\t/**\n\t * Used to create a url for the created container with any data store path given in the relative url.\n\t */\n\turlResolver: IUrlResolver;\n\n\t/**\n\t * Default IFluidCodeDetails used to create containers.\n\t */\n\tdefaultCodeDetails: IFluidCodeDetails;\n\n\t/**\n\t * Contains functions to pause/resume op processing.\n\t */\n\topProcessingController: IOpProcessingController;\n\n\t/**\n\t * Represents the entry point for a Fluid container.\n\t */\n\tcreateFluidEntryPoint: (testContainerConfig?: ITestContainerConfig) => fluidEntryPoint;\n\n\t/**\n\t * Create a loader. Containers created/loaded through this loader will be added to the OpProcessingController.\n\t *\n\t * Only the version of the loader will vary based on compat config. The version of\n\t * containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.\n\t *\n\t * @param packageEntries - list of code details and fluidEntryPoint pairs.\n\t */\n\tcreateLoader(\n\t\tpackageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,\n\t\tloaderProps?: Partial<ILoaderProps>,\n\t): IHostLoader;\n\n\t/**\n\t * Create a container using a default document id and code details.\n\t * Container created is automatically added to the OpProcessingController to manage op flow\n\t *\n\t * Only the version of the loader will vary based on compat config. The version of\n\t * containerRuntime/dataRuntime used in fluidEntryPoint will be used as is from what is passed in.\n\t *\n\t * @param packageEntries - list of code details and fluidEntryPoint pairs.\n\t */\n\n\tcreateContainer(\n\t\tentryPoint: fluidEntryPoint,\n\t\tloaderProps?: Partial<ILoaderProps>,\n\t): Promise<IContainer>;\n\n\t/**\n\t * Create a detached container much like createContainer, but without attaching it to the document service.\n\t */\n\tcreateDetachedContainer(\n\t\tentryPoint: fluidEntryPoint,\n\t\tloaderProps?: Partial<ILoaderProps>,\n\t): Promise<IContainer>;\n\n\t/**\n\t * Attaches a detached container to the document service.\n\t */\n\tattachDetachedContainer(container: IContainer): Promise<void>;\n\n\t/**\n\t * Loads a container using the default document id\n\t */\n\tloadContainer(\n\t\tentryPoint: fluidEntryPoint,\n\t\tloaderProps?: Partial<ILoaderProps>,\n\t\trequestHeader?: IRequestHeader,\n\t): Promise<IContainer>;\n\n\t/**\n\t * Make a test loader. Containers created/loaded through this loader will be added to the OpProcessingController.\n\t * The version of the loader/containerRuntime/dataRuntime may vary based on compat config of the current run\n\t * @param testContainerConfig - optional configuring the test Container\n\t */\n\tmakeTestLoader(testContainerConfig?: ITestContainerConfig): IHostLoader;\n\n\t/**\n\t * Make a container using a default document id and code details\n\t * Container loaded is automatically added to the OpProcessingController to manage op flow\n\t * @param testContainerConfig - optional configuring the test Container\n\t */\n\tmakeTestContainer(testContainerConfig?: ITestContainerConfig): Promise<IContainer>;\n\n\t/**\n\t * Load a container using a default document id and code details.\n\t * IContainer loaded is automatically added to the OpProcessingController to manage op flow\n\t * @param testContainerConfig - optional configuring the test Container\n\t * @param requestHeader - optional headers to be supplied to the loader\n\t */\n\tloadTestContainer(\n\t\ttestContainerConfig?: ITestContainerConfig,\n\t\trequestHeader?: IRequestHeader,\n\t): Promise<IContainer>;\n\n\t/**\n\t * Update the document ID from the resolved container's URL and reset the ID property\n\t */\n\tupdateDocumentId(url: IResolvedUrl | undefined): void;\n\n\t/**\n\t * Make sure all the tracked containers are synchronized.\n\t */\n\tensureSynchronized(timeoutDuration?: number): Promise<void>;\n\n\t/**\n\t * Reset the tracker, closing all containers and stop tracking them.\n\t */\n\tresetLoaderContainerTracker(syncSummarizerClients?: boolean);\n\n\t/**\n\t * Resets and closes all tracked containers and class states.\n\t */\n\treset(): void;\n}\n\n/**\n * @internal\n */\nexport enum DataObjectFactoryType {\n\tPrimed, // default\n\tTest,\n}\n\n/**\n * @internal\n */\nexport interface ITestContainerConfig {\n\t/** TestFluidDataObject instead of PrimedDataStore */\n\tfluidDataObjectType?: DataObjectFactoryType;\n\n\t/** An array of channel name and DDS factory pair to create on container creation time */\n\tregistry?: ChannelFactoryRegistry;\n\n\t/** Container runtime options for the container instance */\n\truntimeOptions?: IContainerRuntimeOptions;\n\n\t/** Whether this runtime should be instantiated using a mixed-in attributor class */\n\tenableAttribution?: boolean;\n\n\t/** Loader options for the loader used to create containers */\n\tloaderProps?: Partial<ILoaderProps>;\n}\n\n/**\n * @internal\n */\nexport const createDocumentId = (): string => uuid();\n\n/**\n * Used to retrieve, update, and reset document id based on the type of driver being used.\n *\n * @internal\n */\nexport interface IDocumentIdStrategy {\n\t/**\n\t * Get document id\n\t */\n\tget(): string;\n\t/**\n\t * Update the document ID from the resolved container's URL and reset the ID property\n\t */\n\tupdate(resolvedUrl?: IResolvedUrl): void;\n\t/**\n\t * Reset document id to a new document id\n\t */\n\treset(): 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\tlet documentId = createDocumentId();\n\tswitch (type) {\n\t\tcase \"odsp\":\n\t\t\treturn {\n\t\t\t\tget: () => documentId,\n\t\t\t\tupdate: () => {}, // do not update the document ID in odsp test cases\n\t\t\t\treset: () => {\n\t\t\t\t\tdocumentId = createDocumentId();\n\t\t\t\t},\n\t\t\t};\n\t\tdefault:\n\t\t\treturn {\n\t\t\t\tget: () => documentId,\n\t\t\t\tupdate: (resolvedUrl?: IResolvedUrl) => {\n\t\t\t\t\t// Extract the document ID from the resolved container's URL and reset the ID property\n\t\t\t\t\tdocumentId = resolvedUrl?.id ?? documentId;\n\t\t\t\t},\n\t\t\t\treset: () => {\n\t\t\t\t\tdocumentId = createDocumentId();\n\t\t\t\t},\n\t\t\t};\n\t}\n}\n\n/**\n * This class tracks events. It allows specifying expected events, which will be looked for in order.\n * It also tracks all unexpected errors.\n * At any point you call reportAndClearTrackedEvents which will provide all unexpected errors, and\n * any expected events that have not occurred.\n * @internal\n */\nexport class EventAndErrorTrackingLogger implements ITelemetryBaseLogger {\n\t/**\n\t * Even if these error events are logged, tests should still be allowed to pass\n\t * Additionally, if downgrade is true, then log as generic (e.g. to avoid polluting the e2e test logs)\n\t */\n\tprivate readonly allowedErrors: { eventName: string; downgrade?: true }[] = [\n\t\t// This log was removed in current version as unnecessary, but it's still present in previous versions\n\t\t{\n\t\t\teventName: \"fluid:telemetry:Container:NoRealStorageInDetachedContainer\",\n\t\t\tdowngrade: true,\n\t\t},\n\t\t// This log's category changes depending on the op latency. test results shouldn't be affected but if we see lots we'd like an alert from the logs.\n\t\t{ eventName: \"fluid:telemetry:OpPerf:OpRoundtripTime\" },\n\t];\n\n\tconstructor(private readonly baseLogger: ITelemetryBaseLogger) {}\n\n\tprivate readonly expectedEvents: (\n\t\t| { index: number; event: ITelemetryGenericEventExt | undefined }\n\t\t| undefined\n\t)[] = [];\n\tprivate readonly unexpectedErrors: ITelemetryBaseEvent[] = [];\n\n\tpublic registerExpectedEvent(...orderedExpectedEvents: ITelemetryGenericEventExt[]) {\n\t\tif (this.expectedEvents.length !== 0) {\n\t\t\t// we don't have to error here. just no reason not to. given the events must be\n\t\t\t// ordered it could be tricky to figure out problems around multiple registrations.\n\t\t\tthrow new Error(\n\t\t\t\t\"Expected events already registered.\\n\" +\n\t\t\t\t\t\"Call reportAndClearTrackedEvents to clear them before registering more\",\n\t\t\t);\n\t\t}\n\t\tthis.expectedEvents.push(\n\t\t\t...orderedExpectedEvents.map((event, index) => ({ index, event })),\n\t\t);\n\t}\n\n\tsend(event: ITelemetryBaseEvent): void {\n\t\tconst ee = this.expectedEvents[0]?.event;\n\t\tif (ee?.eventName === event.eventName) {\n\t\t\tlet matches = true;\n\t\t\tfor (const key of Object.keys(ee)) {\n\t\t\t\tif (ee[key] !== event[key]) {\n\t\t\t\t\tmatches = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (matches) {\n\t\t\t\t// we found an expected event\n\t\t\t\t// so remove it from the list of expected events\n\t\t\t\t// and if it is an error, change it to generic\n\t\t\t\t// this helps keep our telemetry clear of\n\t\t\t\t// expected errors.\n\t\t\t\tthis.expectedEvents.shift();\n\t\t\t\tif (event.category === \"error\") {\n\t\t\t\t\tevent.category = \"generic\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (event.category === \"error\") {\n\t\t\t// Check to see if this error is allowed and if its category should be downgraded\n\t\t\tconst allowedError = this.allowedErrors.find(\n\t\t\t\t({ eventName }) => eventName === event.eventName,\n\t\t\t);\n\n\t\t\tif (allowedError === undefined) {\n\t\t\t\tthis.unexpectedErrors.push(event);\n\t\t\t} else if (allowedError.downgrade) {\n\t\t\t\tevent.category = \"generic\";\n\t\t\t}\n\t\t}\n\n\t\tthis.baseLogger.send(event);\n\t}\n\n\tpublic reportAndClearTrackedEvents() {\n\t\tconst expectedNotFound = this.expectedEvents.splice(0, this.expectedEvents.length);\n\t\tconst unexpectedErrors = this.unexpectedErrors.splice(0, this.unexpectedErrors.length);\n\t\treturn {\n\t\t\texpectedNotFound,\n\t\t\tunexpectedErrors,\n\t\t};\n\t}\n}\n\n/**\n * Shared base class for test object provider. Contain code for loader and container creation and loading\n * @internal\n */\nexport class TestObjectProvider implements ITestObjectProvider {\n\t/**\n\t * {@inheritDoc ITestObjectProvider.\"type\"}\n\t */\n\tpublic readonly type = \"TestObjectProvider\";\n\tprivate _loaderContainerTracker = new LoaderContainerTracker();\n\tprivate _documentServiceFactory: IDocumentServiceFactory | undefined;\n\tprivate _urlResolver: IUrlResolver | undefined;\n\tprivate _logger: EventAndErrorTrackingLogger | undefined;\n\tprivate readonly _documentIdStrategy: IDocumentIdStrategy;\n\t// Since documentId doesn't change we can only create/make one container. Call the load functions instead.\n\tprivate _documentCreated = false;\n\n\t/**\n\t * Manage objects for loading and creating container, including the driver, loader, and OpProcessingController\n\t * @param createFluidEntryPoint - callback to create a fluidEntryPoint, with an optional set of channel name\n\t * and factory for TestFluidObject\n\t */\n\tconstructor(\n\t\tprivate readonly LoaderConstructor: typeof Loader,\n\t\t/**\n\t\t * {@inheritDoc ITestObjectProvider.driver}\n\t\t */\n\t\tpublic readonly driver: ITestDriver,\n\t\t/**\n\t\t * {@inheritDoc ITestObjectProvider.createFluidEntryPoint}\n\t\t */\n\t\tpublic readonly createFluidEntryPoint: (\n\t\t\ttestContainerConfig?: ITestContainerConfig,\n\t\t) => fluidEntryPoint,\n\t) {\n\t\tthis._documentIdStrategy = getDocumentIdStrategy(driver.type);\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.logger}\n\t */\n\tpublic get logger(): EventAndErrorTrackingLogger {\n\t\tif (this._logger === undefined) {\n\t\t\tthis._logger = new EventAndErrorTrackingLogger(\n\t\t\t\tcreateChildLogger({\n\t\t\t\t\tlogger: getTestLogger?.(),\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tall: {\n\t\t\t\t\t\t\tdriverType: this.driver.type,\n\t\t\t\t\t\t\tdriverEndpointName: this.driver.endpointName,\n\t\t\t\t\t\t\tdriverTenantName: this.driver.tenantName,\n\t\t\t\t\t\t\tdriverUserIndex: this.driver.userIndex,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\treturn this._logger;\n\t}\n\n\tprivate set logger(logger: EventAndErrorTrackingLogger) {\n\t\tthis._logger = logger;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.documentServiceFactory}\n\t */\n\tpublic get documentServiceFactory() {\n\t\tif (!this._documentServiceFactory) {\n\t\t\tthis._documentServiceFactory = this.driver.createDocumentServiceFactory();\n\t\t}\n\t\treturn this._documentServiceFactory;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.urlResolver}\n\t */\n\tpublic get urlResolver() {\n\t\tif (!this._urlResolver) {\n\t\t\tthis._urlResolver = this.driver.createUrlResolver();\n\t\t}\n\t\treturn this._urlResolver;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.documentId}\n\t */\n\tpublic get documentId() {\n\t\treturn this._documentIdStrategy.get();\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.defaultCodeDetails}\n\t */\n\tpublic get defaultCodeDetails() {\n\t\treturn defaultCodeDetails;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.opProcessingController}\n\t */\n\tpublic get opProcessingController(): IOpProcessingController {\n\t\treturn this._loaderContainerTracker;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.createLoader}\n\t */\n\tpublic createLoader(\n\t\tpackageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,\n\t\tloaderProps?: Partial<ILoaderProps>,\n\t) {\n\t\tconst logger = createMultiSinkLogger({\n\t\t\tloggers: [this.logger, loaderProps?.logger],\n\t\t});\n\n\t\tconst loader = new this.LoaderConstructor({\n\t\t\t...loaderProps,\n\t\t\tlogger,\n\t\t\tcodeLoader: loaderProps?.codeLoader ?? new LocalCodeLoader(packageEntries),\n\t\t\turlResolver: loaderProps?.urlResolver ?? this.urlResolver,\n\t\t\tdocumentServiceFactory:\n\t\t\t\tloaderProps?.documentServiceFactory ?? this.documentServiceFactory,\n\t\t});\n\t\tthis._loaderContainerTracker.add(loader);\n\t\treturn loader;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.createContainer}\n\t */\n\tpublic async createContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>) {\n\t\tif (this._documentCreated) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Only one container/document can be created. To load the container/document use loadContainer\",\n\t\t\t);\n\t\t}\n\t\tconst loader = this.createLoader([[defaultCodeDetails, entryPoint]], loaderProps);\n\t\tconst container = await createAndAttachContainer(\n\t\t\tdefaultCodeDetails,\n\t\t\tloader,\n\t\t\tthis.driver.createCreateNewRequest(this.documentId),\n\t\t);\n\t\tthis._documentCreated = true;\n\t\t// r11s driver will generate a new ID for the new container.\n\t\t// update the document ID with the actual ID of the attached container.\n\t\tthis._documentIdStrategy.update(container.resolvedUrl);\n\t\treturn container;\n\t}\n\n\t/**\n\t * {@inheritdoc ITestObjectProvider.createDetachedContainer}\n\t */\n\tpublic async createDetachedContainer(\n\t\tentryPoint: fluidEntryPoint,\n\t\tloaderProps?: Partial<ILoaderProps> | undefined,\n\t): Promise<IContainer> {\n\t\tif (this._documentCreated) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Only one container/document can be created. To load the container/document use loadContainer\",\n\t\t\t);\n\t\t}\n\t\tconst loader = this.createLoader([[defaultCodeDetails, entryPoint]], loaderProps);\n\t\treturn loader.createDetachedContainer(defaultCodeDetails);\n\t}\n\n\t/**\n\t * {@inheritdoc ITestObjectProvider.attachDetachedContainer}\n\t */\n\tpublic async attachDetachedContainer(container: IContainer): Promise<void> {\n\t\tif (this._documentCreated) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Only one container/document can be created. To load the container/document use loadContainer\",\n\t\t\t);\n\t\t}\n\t\tawait container.attach(this.driver.createCreateNewRequest(this.documentId));\n\t\tthis._documentCreated = true;\n\t\tthis._documentIdStrategy.update(container.resolvedUrl);\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.loadContainer}\n\t */\n\tpublic async loadContainer(\n\t\tentryPoint: fluidEntryPoint,\n\t\tloaderProps?: Partial<ILoaderProps>,\n\t\trequestHeader?: IRequestHeader,\n\t): Promise<IContainer> {\n\t\tconst loader = this.createLoader([[defaultCodeDetails, entryPoint]], loaderProps);\n\t\treturn this.resolveContainer(loader, requestHeader);\n\t}\n\n\tprivate async resolveContainer(loader: ILoader, headers?: IRequestHeader) {\n\t\treturn loader.resolve({\n\t\t\turl: await this.driver.createContainerUrl(this.documentId),\n\t\t\theaders,\n\t\t});\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.makeTestLoader}\n\t */\n\tpublic makeTestLoader(testContainerConfig?: ITestContainerConfig) {\n\t\treturn this.createLoader(\n\t\t\t[[defaultCodeDetails, this.createFluidEntryPoint(testContainerConfig)]],\n\t\t\ttestContainerConfig?.loaderProps,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.makeTestContainer}\n\t */\n\tpublic async makeTestContainer(\n\t\ttestContainerConfig?: ITestContainerConfig,\n\t): Promise<IContainer> {\n\t\tif (this._documentCreated) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Only one container/document can be created. To load the container/document use loadTestContainer\",\n\t\t\t);\n\t\t}\n\t\tconst loader = this.makeTestLoader(testContainerConfig);\n\t\tconst container = await createAndAttachContainer(\n\t\t\tdefaultCodeDetails,\n\t\t\tloader,\n\t\t\tthis.driver.createCreateNewRequest(this.documentId),\n\t\t);\n\t\tthis._documentCreated = true;\n\t\t// r11s driver will generate a new ID for the new container.\n\t\t// update the document ID with the actual ID of the attached container.\n\t\tthis._documentIdStrategy.update(container.resolvedUrl);\n\t\treturn container;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.loadTestContainer}\n\t */\n\tpublic async loadTestContainer(\n\t\ttestContainerConfig?: ITestContainerConfig,\n\t\trequestHeader?: IRequestHeader,\n\t): Promise<IContainer> {\n\t\tconst loader = this.makeTestLoader(testContainerConfig);\n\n\t\tconst container = await this.resolveContainer(loader, requestHeader);\n\t\tawait this.waitContainerToCatchUp(container);\n\n\t\treturn container;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.reset}\n\t */\n\tpublic reset() {\n\t\tthis._loaderContainerTracker.reset();\n\t\tthis._documentServiceFactory = undefined;\n\t\tthis._urlResolver = undefined;\n\t\tthis._documentIdStrategy.reset();\n\t\tconst logError = getUnexpectedLogErrorException(this._logger);\n\t\tif (logError) {\n\t\t\tthrow logError;\n\t\t}\n\t\tthis._logger = undefined;\n\t\tthis._documentCreated = false;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.ensureSynchronized}\n\t */\n\tpublic async ensureSynchronized(): Promise<void> {\n\t\treturn this._loaderContainerTracker.ensureSynchronized();\n\t}\n\n\tprivate async waitContainerToCatchUp(container: IContainer) {\n\t\t// The original waitContainerToCatchUp() from container loader uses either Container.resume()\n\t\t// or Container.connect() as part of its implementation. However, resume() was deprecated\n\t\t// and eventually replaced with connect(). To avoid issues during LTS compatibility testing\n\t\t// with older container versions issues, we use resume() when connect() is unavailable.\n\t\tif ((container as any).connect === undefined) {\n\t\t\t(container as any).connect = (container as any).resume;\n\t\t}\n\n\t\treturn waitContainerToCatchUp_original(container);\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.updateDocumentId}\n\t */\n\tpublic updateDocumentId(resolvedUrl: IResolvedUrl | undefined) {\n\t\tthis._documentIdStrategy.update(resolvedUrl);\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.resetLoaderContainerTracker}\n\t */\n\tpublic resetLoaderContainerTracker(syncSummarizerClients: boolean = false) {\n\t\tthis._loaderContainerTracker.reset();\n\t\tthis._loaderContainerTracker = new LoaderContainerTracker(syncSummarizerClients);\n\t}\n}\n\n/**\n * Implements {@link ITestObjectProvider}, but uses different versions to create and load containers.\n *\n * @internal\n */\nexport class TestObjectProviderWithVersionedLoad implements ITestObjectProvider {\n\t/**\n\t * {@inheritDoc ITestObjectProvider.\"type\"}\n\t */\n\tpublic readonly type = \"TestObjectProviderWithVersionedLoad\";\n\tprivate _loaderContainerTracker = new LoaderContainerTracker();\n\tprivate _logger: EventAndErrorTrackingLogger | undefined;\n\tprivate readonly _documentIdStrategy: IDocumentIdStrategy;\n\tprivate _documentServiceFactory: IDocumentServiceFactory | undefined;\n\tprivate _urlResolver: IUrlResolver | undefined;\n\t// Since documentId doesn't change we can only create/make one container. Call the load functions instead.\n\tprivate _documentCreated = false;\n\n\t/**\n\t * Used to determine which APIs to use when creating a loader.\n\t *\n\t * The first load will always use the create APIs, and then useCreateApi will be set to false to ensure all\n\t * subsequent loads use the load APIs.\n\t */\n\tprivate useCreateApi: boolean = true;\n\n\tconstructor(\n\t\tprivate readonly LoaderConstructorForCreating: typeof Loader,\n\t\tprivate readonly LoaderConstructorForLoading: typeof Loader,\n\t\tprivate readonly driverForCreating: ITestDriver,\n\t\tprivate readonly driverForLoading: ITestDriver,\n\t\tprivate readonly createFluidEntryPointForCreating: (\n\t\t\ttestContainerConfig?: ITestContainerConfig,\n\t\t) => fluidEntryPoint,\n\t\tprivate readonly createFluidEntryPointForLoading: (\n\t\t\ttestContainerConfig?: ITestContainerConfig,\n\t\t) => fluidEntryPoint,\n\t) {\n\t\tthis._documentIdStrategy = getDocumentIdStrategy(driverForCreating.type);\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.logger}\n\t */\n\tpublic get logger(): EventAndErrorTrackingLogger {\n\t\tif (this._logger === undefined) {\n\t\t\tthis._logger = new EventAndErrorTrackingLogger(\n\t\t\t\tcreateChildLogger({\n\t\t\t\t\tlogger: getTestLogger?.(),\n\t\t\t\t}),\n\t\t\t);\n\t\t}\n\t\treturn this._logger;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.documentServiceFactory}\n\t */\n\tpublic get documentServiceFactory() {\n\t\tif (!this._documentServiceFactory) {\n\t\t\tthis._documentServiceFactory = this.driverForCreating.createDocumentServiceFactory();\n\t\t}\n\t\treturn this._documentServiceFactory;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.urlResolver}\n\t */\n\tpublic get urlResolver() {\n\t\tif (!this._urlResolver) {\n\t\t\tthis._urlResolver = this.driverForCreating.createUrlResolver();\n\t\t}\n\t\treturn this._urlResolver;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.documentId}\n\t */\n\tpublic get documentId() {\n\t\treturn this._documentIdStrategy.get();\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.defaultCodeDetails}\n\t */\n\tpublic get defaultCodeDetails() {\n\t\treturn defaultCodeDetails;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.opProcessingController}\n\t */\n\tpublic get opProcessingController(): IOpProcessingController {\n\t\treturn this._loaderContainerTracker;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.driver}\n\t */\n\tpublic get driver(): ITestDriver {\n\t\treturn this.useCreateApi ? this.driverForCreating : this.driverForLoading;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.createFluidEntryPoint}\n\t */\n\tpublic get createFluidEntryPoint(): (\n\t\ttestContainerConfig?: ITestContainerConfig,\n\t) => fluidEntryPoint {\n\t\treturn this.useCreateApi\n\t\t\t? this.createFluidEntryPointForCreating\n\t\t\t: this.createFluidEntryPointForLoading;\n\t}\n\n\tprivate createLoaderForCreating(\n\t\tpackageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,\n\t\tloaderProps?: Partial<ILoaderProps>,\n\t) {\n\t\tconst logger = createMultiSinkLogger({\n\t\t\tloggers: [this.logger, loaderProps?.logger],\n\t\t});\n\n\t\tconst loader = new this.LoaderConstructorForCreating({\n\t\t\t...loaderProps,\n\t\t\tlogger,\n\t\t\tcodeLoader: loaderProps?.codeLoader ?? new LocalCodeLoader(packageEntries),\n\t\t\turlResolver: loaderProps?.urlResolver ?? this.urlResolver,\n\t\t\tdocumentServiceFactory:\n\t\t\t\tloaderProps?.documentServiceFactory ?? this.documentServiceFactory,\n\t\t});\n\n\t\tthis._loaderContainerTracker.add(loader);\n\t\treturn loader;\n\t}\n\n\tprivate createLoaderForLoading(\n\t\tpackageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,\n\t\tloaderProps?: Partial<ILoaderProps>,\n\t) {\n\t\tconst logger = createMultiSinkLogger({\n\t\t\tloggers: [this.logger, loaderProps?.logger],\n\t\t});\n\n\t\tconst loader = new this.LoaderConstructorForLoading({\n\t\t\t...loaderProps,\n\t\t\tlogger,\n\t\t\tcodeLoader: loaderProps?.codeLoader ?? new LocalCodeLoader(packageEntries),\n\t\t\turlResolver: loaderProps?.urlResolver ?? this.urlResolver,\n\t\t\tdocumentServiceFactory:\n\t\t\t\tloaderProps?.documentServiceFactory ?? this.documentServiceFactory,\n\t\t});\n\n\t\tthis._loaderContainerTracker.add(loader);\n\t\treturn loader;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.createLoader}\n\t */\n\tpublic createLoader(\n\t\tpackageEntries: Iterable<[IFluidCodeDetails, fluidEntryPoint]>,\n\t\tloaderProps?: Partial<ILoaderProps>,\n\t) {\n\t\tif (this.useCreateApi) {\n\t\t\t// After we create the first loader, we can set this.useCreateApi to false.\n\t\t\tthis.useCreateApi = false;\n\t\t\treturn this.createLoaderForCreating(packageEntries, loaderProps);\n\t\t}\n\t\treturn this.createLoaderForLoading(packageEntries, loaderProps);\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.createContainer}\n\t */\n\tpublic async createContainer(entryPoint: fluidEntryPoint, loaderProps?: Partial<ILoaderProps>) {\n\t\tif (this._documentCreated) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Only one container/document can be created. To load the container/document use loadContainer\",\n\t\t\t);\n\t\t}\n\t\tconst loader = this.createLoader([[defaultCodeDetails, entryPoint]], loaderProps);\n\t\tconst container = await createAndAttachContainer(\n\t\t\tdefaultCodeDetails,\n\t\t\tloader,\n\t\t\tthis.driverForCreating.createCreateNewRequest(this.documentId),\n\t\t);\n\t\tthis._documentCreated = true;\n\t\t// r11s driver will generate a new ID for the new container.\n\t\t// update the document ID with the actual ID of the attached container.\n\t\tthis._documentIdStrategy.update(container.resolvedUrl);\n\t\treturn container;\n\t}\n\n\t/**\n\t * {@inheritdoc ITestObjectProvider.createDetachedContainer}\n\t */\n\tpublic async createDetachedContainer(\n\t\tentryPoint: fluidEntryPoint,\n\t\tloaderProps?: Partial<ILoaderProps> | undefined,\n\t): Promise<IContainer> {\n\t\tif (this._documentCreated) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Only one container/document can be created. To load the container/document use loadContainer\",\n\t\t\t);\n\t\t}\n\t\tconst loader = this.createLoader([[defaultCodeDetails, entryPoint]], loaderProps);\n\t\treturn loader.createDetachedContainer(defaultCodeDetails);\n\t}\n\n\t/**\n\t * {@inheritdoc ITestObjectProvider.attachDetachedContainer}\n\t */\n\tpublic async attachDetachedContainer(container: IContainer): Promise<void> {\n\t\tif (this._documentCreated) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Only one container/document can be created. To load the container/document use loadContainer\",\n\t\t\t);\n\t\t}\n\t\tawait container.attach(this.driver.createCreateNewRequest(this.documentId));\n\t\tthis._documentCreated = true;\n\t\tthis._documentIdStrategy.update(container.resolvedUrl);\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.loadContainer}\n\t */\n\tpublic async loadContainer(\n\t\tentryPoint: fluidEntryPoint,\n\t\tloaderProps?: Partial<ILoaderProps>,\n\t\trequestHeader?: IRequestHeader,\n\t): Promise<IContainer> {\n\t\tconst driver = this.useCreateApi ? this.driverForCreating : this.driverForLoading;\n\t\tconst loader = this.createLoader([[defaultCodeDetails, entryPoint]], loaderProps);\n\t\treturn this.resolveContainer(loader, requestHeader, driver);\n\t}\n\n\tprivate async resolveContainer(\n\t\tloader: ILoader,\n\t\theaders?: IRequestHeader,\n\t\tdriver?: ITestDriver,\n\t) {\n\t\treturn loader.resolve({\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\turl: await driver!.createContainerUrl(this.documentId),\n\t\t\theaders,\n\t\t});\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.makeTestLoader}\n\t */\n\tpublic makeTestLoader(testContainerConfig?: ITestContainerConfig) {\n\t\treturn this.createLoader(\n\t\t\t[[defaultCodeDetails, this.createFluidEntryPoint(testContainerConfig)]],\n\t\t\ttestContainerConfig?.loaderProps,\n\t\t);\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.makeTestContainer}\n\t */\n\tpublic async makeTestContainer(\n\t\ttestContainerConfig?: ITestContainerConfig,\n\t): Promise<IContainer> {\n\t\tif (this._documentCreated) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Only one container/document can be created. To load the container/document use loadTestContainer\",\n\t\t\t);\n\t\t}\n\t\tconst loader = this.createLoader(\n\t\t\t[[defaultCodeDetails, this.createFluidEntryPoint(testContainerConfig)]],\n\t\t\ttestContainerConfig?.loaderProps,\n\t\t);\n\t\tconst container = await createAndAttachContainer(\n\t\t\tdefaultCodeDetails,\n\t\t\tloader,\n\t\t\tthis.driverForCreating.createCreateNewRequest(this.documentId),\n\t\t);\n\t\tthis._documentCreated = true;\n\t\t// r11s driver will generate a new ID for the new container.\n\t\t// update the document ID with the actual ID of the attached container.\n\t\tthis._documentIdStrategy.update(container.resolvedUrl);\n\t\treturn container;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.loadTestContainer}\n\t */\n\tpublic async loadTestContainer(\n\t\ttestContainerConfig?: ITestContainerConfig,\n\t\trequestHeader?: IRequestHeader,\n\t): Promise<IContainer> {\n\t\t// Keep track of which Loader we are about to use so we can pass the correct driver through\n\t\tconst driver = this.useCreateApi ? this.driverForCreating : this.driverForLoading;\n\t\tconst loader = this.makeTestLoader(testContainerConfig);\n\t\tconst container = await this.resolveContainer(loader, requestHeader, driver);\n\t\tawait this.waitContainerToCatchUp(container);\n\n\t\treturn container;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.reset}\n\t */\n\tpublic reset() {\n\t\tthis.useCreateApi = true;\n\t\tthis._loaderContainerTracker.reset();\n\t\tthis._logger = undefined;\n\t\tthis._documentServiceFactory = undefined;\n\t\tthis._urlResolver = undefined;\n\t\tthis._documentIdStrategy.reset();\n\t\tconst logError = getUnexpectedLogErrorException(this._logger);\n\t\tif (logError) {\n\t\t\tthrow logError;\n\t\t}\n\t\tthis._documentCreated = false;\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.ensureSynchronized}\n\t */\n\tpublic async ensureSynchronized(): Promise<void> {\n\t\treturn this._loaderContainerTracker.ensureSynchronized();\n\t}\n\n\tprivate async waitContainerToCatchUp(container: IContainer) {\n\t\t// The original waitContainerToCatchUp() from container loader uses either Container.resume()\n\t\t// or Container.connect() as part of its implementation. However, resume() was deprecated\n\t\t// and eventually replaced with connect(). To avoid issues during LTS compatibility testing\n\t\t// with older container versions issues, we use resume() when connect() is unavailable.\n\t\tif ((container as any).connect === undefined) {\n\t\t\t(container as any).connect = (container as any).resume;\n\t\t}\n\n\t\treturn waitContainerToCatchUp_original(container);\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.updateDocumentId}\n\t */\n\tpublic updateDocumentId(resolvedUrl: IResolvedUrl | undefined) {\n\t\tthis._documentIdStrategy.update(resolvedUrl);\n\t}\n\n\t/**\n\t * {@inheritDoc ITestObjectProvider.resetLoaderContainerTracker}\n\t */\n\tpublic resetLoaderContainerTracker(syncSummarizerClients: boolean = false) {\n\t\tthis._loaderContainerTracker.reset();\n\t\tthis._loaderContainerTracker = new LoaderContainerTracker(syncSummarizerClients);\n\t}\n}\n\n/**\n * @internal\n */\nexport function getUnexpectedLogErrorException(\n\tlogger: EventAndErrorTrackingLogger | undefined,\n\tprefix?: string,\n) {\n\tif (logger === undefined) {\n\t\treturn;\n\t}\n\tconst results = logger.reportAndClearTrackedEvents();\n\tif (results.unexpectedErrors.length > 0) {\n\t\treturn new Error(\n\t\t\t`${prefix ?? \"\"}Unexpected Errors in Logs:\\n${JSON.stringify(\n\t\t\t\tresults.unexpectedErrors,\n\t\t\t\tundefined,\n\t\t\t\t2,\n\t\t\t)}`,\n\t\t);\n\t}\n\tif (results.expectedNotFound.length > 0) {\n\t\treturn new Error(\n\t\t\t`${prefix ?? \"\"}Expected Events not found:\\n${JSON.stringify(\n\t\t\t\tresults.expectedNotFound,\n\t\t\t\tundefined,\n\t\t\t\t2,\n\t\t\t)}`,\n\t\t);\n\t}\n}\n"]}
@@ -0,0 +1,60 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ /**
6
+ * @internal
7
+ */
8
+ export declare const defaultTimeoutDurationMs = 250;
9
+ /**
10
+ * @internal
11
+ */
12
+ export interface TimeoutWithError {
13
+ /**
14
+ * Timeout duration in milliseconds, if it is great than 0 and not Infinity
15
+ * If it is undefined, then it will use test timeout if we are in side the test function
16
+ * Otherwise, there is no timeout
17
+ */
18
+ durationMs?: number;
19
+ reject?: true;
20
+ errorMsg?: string;
21
+ }
22
+ /**
23
+ * @internal
24
+ */
25
+ export interface TimeoutWithValue<T = void> {
26
+ /**
27
+ * Timeout duration in milliseconds, if it is great than 0 and not Infinity
28
+ * If it is undefined, then it will use test timeout if we are in side the test function
29
+ * Otherwise, there is no timeout
30
+ */
31
+ durationMs?: number;
32
+ reject: false;
33
+ value: T;
34
+ }
35
+ export type PromiseExecutor<T = void> = (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void;
36
+ /**
37
+ * Wraps the given promise around with promise that will complete after a specific timeout if the original promise does
38
+ * not resolve by then. By default, it uses the mocha test timeout and complete the promise just before that so that
39
+ * tests don't time out because of unpredictable awaits.
40
+ * The timeout can be overridden via timeoutOptions but it's recommended to use the default value.
41
+ * @param promise - The promise to be awaited.
42
+ * @param timeoutOptions - Options that can be used to override the timeout and / or define the behavior
43
+ * when the promise is not fulfilled. For example, instead of rejecting the promise, resolve with a
44
+ * specific value.
45
+ * @returns A new promise that will complete when the given promise resolves or the timeout expires.
46
+ * @internal
47
+ */
48
+ export declare function timeoutAwait<T = void>(promise: PromiseLike<T>, timeoutOptions?: TimeoutWithError | TimeoutWithValue<T>): Promise<T>;
49
+ /**
50
+ * Creates a promise from the given executor that will complete after a specific timeout. By default, it uses the mocha
51
+ * test timeout and complete the promise just before that so that tests don't time out because of unpredictable awaits.
52
+ * The timeout can be overridden via timeoutOptions but it's recommended to use the default value.
53
+ * @param executor - The executor for the promise.
54
+ * @param timeoutOptions - Options that can be used to override the timeout and / or define the behavior when
55
+ * the promise is not fulfilled. For example, instead of rejecting the promise, resolve with a specific value.
56
+ * @returns A new promise that will complete when the given executor resolves or the timeout expires.
57
+ * @internal
58
+ */
59
+ export declare function timeoutPromise<T = void>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void, timeoutOptions?: TimeoutWithError | TimeoutWithValue<T>): Promise<T>;
60
+ //# sourceMappingURL=timeoutUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeoutUtils.d.ts","sourceRoot":"","sources":["../src/timeoutUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;GAEG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAAC;AA8F5C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AACD;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,IAAI;IACzC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC;IACd,KAAK,EAAE,CAAC,CAAC;CACT;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,IAAI,IAAI,CACvC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,EAC5C,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,KAC1B,IAAI,CAAC;AAEV;;;;;;;;;;;GAWG;AACH,wBAAsB,YAAY,CAAC,CAAC,GAAG,IAAI,EAC1C,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,EACvB,cAAc,GAAE,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAM,GACzD,OAAO,CAAC,CAAC,CAAC,CAEZ;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,CAAC,GAAG,IAAI,EAC5C,QAAQ,EAAE,CACT,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,EAC5C,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,KAC1B,IAAI,EACT,cAAc,GAAE,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CAAM,GACzD,OAAO,CAAC,CAAC,CAAC,CA6BZ"}
@@ -0,0 +1,164 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ import { assert, Deferred } from "@fluidframework/core-utils";
6
+ // @deprecated this value is no longer used
7
+ /**
8
+ * @internal
9
+ */
10
+ export const defaultTimeoutDurationMs = 250;
11
+ const timeBuffer = 15; // leave 15 ms leeway for finish processing
12
+ // TestTimeout class that manages tracking of test timeout. It creates a timer when timeout is in effect,
13
+ // and provides a promise that will be rejected some time (as defined by `timeBuffer`) before the test timeout happens.
14
+ // This will ensure that async awaits in tests do not end up timing out the tests but resolve / reject
15
+ // before that happens.
16
+ // Once rejected, a new TestTimeout object will be create for the timeout.
17
+ class TestTimeout {
18
+ static reset(runnable) {
19
+ TestTimeout.clear();
20
+ TestTimeout.instance.resetTimer(runnable);
21
+ }
22
+ static clear() {
23
+ if (TestTimeout.instance.rejected) {
24
+ TestTimeout.instance = new TestTimeout();
25
+ }
26
+ else {
27
+ TestTimeout.instance.clearTimer();
28
+ }
29
+ }
30
+ static getInstance() {
31
+ return TestTimeout.instance;
32
+ }
33
+ async getPromise() {
34
+ return this.deferred.promise;
35
+ }
36
+ getTimeout() {
37
+ return this.timeout;
38
+ }
39
+ constructor() {
40
+ this.timeout = 0;
41
+ this.rejected = false;
42
+ this.deferred = new Deferred();
43
+ // Ignore rejection for timeout promise if no one is waiting for it.
44
+ this.deferred.promise.catch(() => { });
45
+ }
46
+ resetTimer(runnable) {
47
+ assert(!this.timer, "clearTimer should have been called before reset");
48
+ assert(!this.deferred.isCompleted, "can't reset a completed TestTimeout");
49
+ // Check the test timeout setting
50
+ const timeout = runnable.timeout();
51
+ if (!(Number.isFinite(timeout) && timeout > 0)) {
52
+ return;
53
+ }
54
+ // subtract a buffer
55
+ this.timeout = Math.max(timeout - timeBuffer, 1);
56
+ // Set up timer to reject near the test timeout.
57
+ this.timer = setTimeout(() => {
58
+ this.deferred.reject(this);
59
+ this.rejected = true;
60
+ }, this.timeout);
61
+ }
62
+ clearTimer() {
63
+ if (this.timer) {
64
+ clearTimeout(this.timer);
65
+ this.timer = undefined;
66
+ }
67
+ }
68
+ }
69
+ TestTimeout.instance = new TestTimeout();
70
+ // only register if we are running with mocha-test-setup loaded
71
+ if (globalThis.getMochaModule !== undefined) {
72
+ // patching resetTimeout and clearTimeout on the runnable object
73
+ // so we can track when test timeout are enforced
74
+ const mochaModule = globalThis.getMochaModule();
75
+ const runnablePrototype = mochaModule.Runnable.prototype;
76
+ // eslint-disable-next-line @typescript-eslint/unbound-method
77
+ const oldResetTimeoutFunc = runnablePrototype.resetTimeout;
78
+ runnablePrototype.resetTimeout = function () {
79
+ oldResetTimeoutFunc.call(this);
80
+ TestTimeout.reset(this);
81
+ };
82
+ // eslint-disable-next-line @typescript-eslint/unbound-method
83
+ const oldClearTimeoutFunc = runnablePrototype.clearTimeout;
84
+ runnablePrototype.clearTimeout = function () {
85
+ TestTimeout.clear();
86
+ oldClearTimeoutFunc.call(this);
87
+ };
88
+ }
89
+ /**
90
+ * Wraps the given promise around with promise that will complete after a specific timeout if the original promise does
91
+ * not resolve by then. By default, it uses the mocha test timeout and complete the promise just before that so that
92
+ * tests don't time out because of unpredictable awaits.
93
+ * The timeout can be overridden via timeoutOptions but it's recommended to use the default value.
94
+ * @param promise - The promise to be awaited.
95
+ * @param timeoutOptions - Options that can be used to override the timeout and / or define the behavior
96
+ * when the promise is not fulfilled. For example, instead of rejecting the promise, resolve with a
97
+ * specific value.
98
+ * @returns A new promise that will complete when the given promise resolves or the timeout expires.
99
+ * @internal
100
+ */
101
+ export async function timeoutAwait(promise, timeoutOptions = {}) {
102
+ return Promise.race([promise, timeoutPromise(() => { }, timeoutOptions)]);
103
+ }
104
+ /**
105
+ * Creates a promise from the given executor that will complete after a specific timeout. By default, it uses the mocha
106
+ * test timeout and complete the promise just before that so that tests don't time out because of unpredictable awaits.
107
+ * The timeout can be overridden via timeoutOptions but it's recommended to use the default value.
108
+ * @param executor - The executor for the promise.
109
+ * @param timeoutOptions - Options that can be used to override the timeout and / or define the behavior when
110
+ * the promise is not fulfilled. For example, instead of rejecting the promise, resolve with a specific value.
111
+ * @returns A new promise that will complete when the given executor resolves or the timeout expires.
112
+ * @internal
113
+ */
114
+ export async function timeoutPromise(executor, timeoutOptions = {}) {
115
+ // create the timeout error outside the async task, so its callstack includes
116
+ // the original call site, this makes it easier to debug
117
+ const err = timeoutOptions.reject === false
118
+ ? undefined
119
+ : new Error(timeoutOptions.errorMsg ?? "Timed out");
120
+ const executorPromise = getTimeoutPromise(executor, timeoutOptions, err);
121
+ const currentTestTimeout = TestTimeout.getInstance();
122
+ if (currentTestTimeout === undefined) {
123
+ return executorPromise;
124
+ }
125
+ return Promise.race([executorPromise, currentTestTimeout.getPromise()]).catch((e) => {
126
+ if (e === currentTestTimeout) {
127
+ if (timeoutOptions.reject !== false) {
128
+ // If the rejection is because of the timeout then
129
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
130
+ const errorObject = err;
131
+ errorObject.message = `${timeoutOptions.errorMsg ?? "Test timed out"} (${currentTestTimeout.getTimeout()}ms)`;
132
+ throw errorObject;
133
+ }
134
+ return timeoutOptions.value;
135
+ }
136
+ throw e;
137
+ });
138
+ }
139
+ // Create a promise based on the timeout options
140
+ async function getTimeoutPromise(executor, timeoutOptions, err) {
141
+ const timeout = timeoutOptions.durationMs ?? 0;
142
+ if (timeout <= 0 || !Number.isFinite(timeout)) {
143
+ return new Promise(executor);
144
+ }
145
+ return new Promise((resolve, reject) => {
146
+ const timeoutRejections = () => {
147
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
148
+ const errorObject = err;
149
+ errorObject.message = `${errorObject.message} (${timeout}ms)`;
150
+ reject(err);
151
+ };
152
+ const timer = setTimeout(() => timeoutOptions.reject === false
153
+ ? resolve(timeoutOptions.value)
154
+ : timeoutRejections(), timeout);
155
+ executor((value) => {
156
+ clearTimeout(timer);
157
+ resolve(value);
158
+ }, (reason) => {
159
+ clearTimeout(timer);
160
+ reject(reason);
161
+ });
162
+ });
163
+ }
164
+ //# sourceMappingURL=timeoutUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeoutUtils.js","sourceRoot":"","sources":["../src/timeoutUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG9D,2CAA2C;AAC3C;;GAEG;AACH,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reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Deferred } from \"@fluidframework/core-utils\";\nimport type * as Mocha from \"mocha\";\n\n// @deprecated this value is no longer used\n/**\n * @internal\n */\nexport const defaultTimeoutDurationMs = 250;\n\nconst timeBuffer = 15; // leave 15 ms leeway for finish processing\n\n// TestTimeout class that manages tracking of test timeout. It creates a timer when timeout is in effect,\n// and provides a promise that will be rejected some time (as defined by `timeBuffer`) before the test timeout happens.\n// This will ensure that async awaits in tests do not end up timing out the tests but resolve / reject\n// before that happens.\n// Once rejected, a new TestTimeout object will be create for the timeout.\nclass TestTimeout {\n\tprivate timeout: number = 0;\n\tprivate timer: NodeJS.Timeout | undefined;\n\tprivate readonly deferred: Deferred<void>;\n\tprivate rejected = false;\n\n\tprivate static instance: TestTimeout = new TestTimeout();\n\tpublic static reset(runnable: Mocha.Runnable) {\n\t\tTestTimeout.clear();\n\t\tTestTimeout.instance.resetTimer(runnable);\n\t}\n\n\tpublic static clear() {\n\t\tif (TestTimeout.instance.rejected) {\n\t\t\tTestTimeout.instance = new TestTimeout();\n\t\t} else {\n\t\t\tTestTimeout.instance.clearTimer();\n\t\t}\n\t}\n\n\tpublic static getInstance() {\n\t\treturn TestTimeout.instance;\n\t}\n\n\tpublic async getPromise() {\n\t\treturn this.deferred.promise;\n\t}\n\n\tpublic getTimeout() {\n\t\treturn this.timeout;\n\t}\n\n\tprivate constructor() {\n\t\tthis.deferred = new Deferred();\n\t\t// Ignore rejection for timeout promise if no one is waiting for it.\n\t\tthis.deferred.promise.catch(() => {});\n\t}\n\n\tprivate resetTimer(runnable: Mocha.Runnable) {\n\t\tassert(!this.timer, \"clearTimer should have been called before reset\");\n\t\tassert(!this.deferred.isCompleted, \"can't reset a completed TestTimeout\");\n\n\t\t// Check the test timeout setting\n\t\tconst timeout = runnable.timeout();\n\t\tif (!(Number.isFinite(timeout) && timeout > 0)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// subtract a buffer\n\t\tthis.timeout = Math.max(timeout - timeBuffer, 1);\n\n\t\t// Set up timer to reject near the test timeout.\n\t\tthis.timer = setTimeout(() => {\n\t\t\tthis.deferred.reject(this);\n\t\t\tthis.rejected = true;\n\t\t}, this.timeout);\n\t}\n\tprivate clearTimer() {\n\t\tif (this.timer) {\n\t\t\tclearTimeout(this.timer);\n\t\t\tthis.timer = undefined;\n\t\t}\n\t}\n}\n\n// only register if we are running with mocha-test-setup loaded\nif (globalThis.getMochaModule !== undefined) {\n\t// patching resetTimeout and clearTimeout on the runnable object\n\t// so we can track when test timeout are enforced\n\tconst mochaModule = globalThis.getMochaModule() as typeof Mocha;\n\tconst runnablePrototype = mochaModule.Runnable.prototype;\n\t// eslint-disable-next-line @typescript-eslint/unbound-method\n\tconst oldResetTimeoutFunc = runnablePrototype.resetTimeout;\n\trunnablePrototype.resetTimeout = function (this: Mocha.Runnable) {\n\t\toldResetTimeoutFunc.call(this);\n\t\tTestTimeout.reset(this);\n\t};\n\t// eslint-disable-next-line @typescript-eslint/unbound-method\n\tconst oldClearTimeoutFunc = runnablePrototype.clearTimeout;\n\trunnablePrototype.clearTimeout = function (this: Mocha.Runnable) {\n\t\tTestTimeout.clear();\n\t\toldClearTimeoutFunc.call(this);\n\t};\n}\n\n/**\n * @internal\n */\nexport interface TimeoutWithError {\n\t/**\n\t * Timeout duration in milliseconds, if it is great than 0 and not Infinity\n\t * If it is undefined, then it will use test timeout if we are in side the test function\n\t * Otherwise, there is no timeout\n\t */\n\tdurationMs?: number;\n\treject?: true;\n\terrorMsg?: string;\n}\n/**\n * @internal\n */\nexport interface TimeoutWithValue<T = void> {\n\t/**\n\t * Timeout duration in milliseconds, if it is great than 0 and not Infinity\n\t * If it is undefined, then it will use test timeout if we are in side the test function\n\t * Otherwise, there is no timeout\n\t */\n\tdurationMs?: number;\n\treject: false;\n\tvalue: T;\n}\n\nexport type PromiseExecutor<T = void> = (\n\tresolve: (value: T | PromiseLike<T>) => void,\n\treject: (reason?: any) => void,\n) => void;\n\n/**\n * Wraps the given promise around with promise that will complete after a specific timeout if the original promise does\n * not resolve by then. By default, it uses the mocha test timeout and complete the promise just before that so that\n * tests don't time out because of unpredictable awaits.\n * The timeout can be overridden via timeoutOptions but it's recommended to use the default value.\n * @param promise - The promise to be awaited.\n * @param timeoutOptions - Options that can be used to override the timeout and / or define the behavior\n * when the promise is not fulfilled. For example, instead of rejecting the promise, resolve with a\n * specific value.\n * @returns A new promise that will complete when the given promise resolves or the timeout expires.\n * @internal\n */\nexport async function timeoutAwait<T = void>(\n\tpromise: PromiseLike<T>,\n\ttimeoutOptions: TimeoutWithError | TimeoutWithValue<T> = {},\n): Promise<T> {\n\treturn Promise.race([promise, timeoutPromise<T>(() => {}, timeoutOptions)]);\n}\n\n/**\n * Creates a promise from the given executor that will complete after a specific timeout. By default, it uses the mocha\n * test timeout and complete the promise just before that so that tests don't time out because of unpredictable awaits.\n * The timeout can be overridden via timeoutOptions but it's recommended to use the default value.\n * @param executor - The executor for the promise.\n * @param timeoutOptions - Options that can be used to override the timeout and / or define the behavior when\n * the promise is not fulfilled. For example, instead of rejecting the promise, resolve with a specific value.\n * @returns A new promise that will complete when the given executor resolves or the timeout expires.\n * @internal\n */\nexport async function timeoutPromise<T = void>(\n\texecutor: (\n\t\tresolve: (value: T | PromiseLike<T>) => void,\n\t\treject: (reason?: any) => void,\n\t) => void,\n\ttimeoutOptions: TimeoutWithError | TimeoutWithValue<T> = {},\n): Promise<T> {\n\t// create the timeout error outside the async task, so its callstack includes\n\t// the original call site, this makes it easier to debug\n\tconst err =\n\t\ttimeoutOptions.reject === false\n\t\t\t? undefined\n\t\t\t: new Error(timeoutOptions.errorMsg ?? \"Timed out\");\n\tconst executorPromise = getTimeoutPromise(executor, timeoutOptions, err);\n\n\tconst currentTestTimeout = TestTimeout.getInstance();\n\tif (currentTestTimeout === undefined) {\n\t\treturn executorPromise;\n\t}\n\n\treturn Promise.race([executorPromise, currentTestTimeout.getPromise()]).catch((e) => {\n\t\tif (e === currentTestTimeout) {\n\t\t\tif (timeoutOptions.reject !== false) {\n\t\t\t\t// If the rejection is because of the timeout then\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\t\tconst errorObject = err!;\n\t\t\t\terrorObject.message = `${\n\t\t\t\t\ttimeoutOptions.errorMsg ?? \"Test timed out\"\n\t\t\t\t} (${currentTestTimeout.getTimeout()}ms)`;\n\t\t\t\tthrow errorObject;\n\t\t\t}\n\t\t\treturn timeoutOptions.value;\n\t\t}\n\t\tthrow e;\n\t}) as Promise<T>;\n}\n\n// Create a promise based on the timeout options\nasync function getTimeoutPromise<T = void>(\n\texecutor: (\n\t\tresolve: (value: T | PromiseLike<T>) => void,\n\t\treject: (reason?: any) => void,\n\t) => void,\n\ttimeoutOptions: TimeoutWithError | TimeoutWithValue<T>,\n\terr: Error | undefined,\n) {\n\tconst timeout = timeoutOptions.durationMs ?? 0;\n\tif (timeout <= 0 || !Number.isFinite(timeout)) {\n\t\treturn new Promise(executor);\n\t}\n\n\treturn new Promise<T>((resolve, reject) => {\n\t\tconst timeoutRejections = () => {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst errorObject = err!;\n\t\t\terrorObject.message = `${errorObject.message} (${timeout}ms)`;\n\t\t\treject(err);\n\t\t};\n\t\tconst timer = setTimeout(\n\t\t\t() =>\n\t\t\t\ttimeoutOptions.reject === false\n\t\t\t\t\t? resolve(timeoutOptions.value)\n\t\t\t\t\t: timeoutRejections(),\n\t\t\ttimeout,\n\t\t);\n\n\t\texecutor(\n\t\t\t(value) => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve(value);\n\t\t\t},\n\t\t\t(reason) => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\treject(reason);\n\t\t\t},\n\t\t);\n\t});\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/test-utils",
3
- "version": "2.0.0-dev-rc.1.0.0.232845",
3
+ "version": "2.0.0-dev-rc.2.0.0.245554",
4
4
  "description": "Utilities for Fluid tests",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -11,6 +11,49 @@
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
13
  "sideEffects": false,
14
+ "type": "module",
15
+ "exports": {
16
+ ".": {
17
+ "import": {
18
+ "types": "./lib/index.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "require": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/index.js"
24
+ }
25
+ },
26
+ "./public": {
27
+ "import": {
28
+ "types": "./lib/test-utils-public.d.ts",
29
+ "default": "./lib/index.js"
30
+ },
31
+ "require": {
32
+ "types": "./dist/test-utils-public.d.ts",
33
+ "default": "./dist/index.js"
34
+ }
35
+ },
36
+ "./alpha": {
37
+ "import": {
38
+ "types": "./lib/test-utils-alpha.d.ts",
39
+ "default": "./lib/index.js"
40
+ },
41
+ "require": {
42
+ "types": "./dist/test-utils-alpha.d.ts",
43
+ "default": "./dist/index.js"
44
+ }
45
+ },
46
+ "./internal": {
47
+ "import": {
48
+ "types": "./lib/index.d.ts",
49
+ "default": "./lib/index.js"
50
+ },
51
+ "require": {
52
+ "types": "./dist/index.d.ts",
53
+ "default": "./dist/index.js"
54
+ }
55
+ }
56
+ },
14
57
  "main": "dist/index.js",
15
58
  "types": "dist/index.d.ts",
16
59
  "c8": {
@@ -18,12 +61,12 @@
18
61
  "cache-dir": "nyc/.cache",
19
62
  "exclude": [
20
63
  "src/test/**/*.*ts",
21
- "dist/test/**/*.*js"
64
+ "lib/test/**/*.*js"
22
65
  ],
23
66
  "exclude-after-remap": false,
24
67
  "include": [
25
68
  "src/**/*.*ts",
26
- "dist/**/*.*js"
69
+ "lib/**/*.*js"
27
70
  ],
28
71
  "report-dir": "nyc/report",
29
72
  "reporter": [
@@ -34,40 +77,40 @@
34
77
  "temp-directory": "nyc/.nyc_output"
35
78
  },
36
79
  "dependencies": {
37
- "@fluidframework/aqueduct": "2.0.0-dev-rc.1.0.0.232845",
38
- "@fluidframework/container-definitions": "2.0.0-dev-rc.1.0.0.232845",
39
- "@fluidframework/container-loader": "2.0.0-dev-rc.1.0.0.232845",
40
- "@fluidframework/container-runtime": "2.0.0-dev-rc.1.0.0.232845",
41
- "@fluidframework/container-runtime-definitions": "2.0.0-dev-rc.1.0.0.232845",
42
- "@fluidframework/core-interfaces": "2.0.0-dev-rc.1.0.0.232845",
43
- "@fluidframework/core-utils": "2.0.0-dev-rc.1.0.0.232845",
44
- "@fluidframework/datastore": "2.0.0-dev-rc.1.0.0.232845",
45
- "@fluidframework/datastore-definitions": "2.0.0-dev-rc.1.0.0.232845",
46
- "@fluidframework/driver-definitions": "2.0.0-dev-rc.1.0.0.232845",
47
- "@fluidframework/driver-utils": "2.0.0-dev-rc.1.0.0.232845",
48
- "@fluidframework/local-driver": "2.0.0-dev-rc.1.0.0.232845",
49
- "@fluidframework/map": "2.0.0-dev-rc.1.0.0.232845",
50
- "@fluidframework/protocol-definitions": "^3.2.0-231454",
51
- "@fluidframework/request-handler": "2.0.0-dev-rc.1.0.0.232845",
52
- "@fluidframework/routerlicious-driver": "2.0.0-dev-rc.1.0.0.232845",
53
- "@fluidframework/runtime-definitions": "2.0.0-dev-rc.1.0.0.232845",
54
- "@fluidframework/runtime-utils": "2.0.0-dev-rc.1.0.0.232845",
55
- "@fluidframework/telemetry-utils": "2.0.0-dev-rc.1.0.0.232845",
56
- "@fluidframework/test-driver-definitions": "2.0.0-dev-rc.1.0.0.232845",
57
- "@fluidframework/test-runtime-utils": "2.0.0-dev-rc.1.0.0.232845",
80
+ "@fluidframework/aqueduct": "2.0.0-dev-rc.2.0.0.245554",
81
+ "@fluidframework/container-definitions": "2.0.0-dev-rc.2.0.0.245554",
82
+ "@fluidframework/container-loader": "2.0.0-dev-rc.2.0.0.245554",
83
+ "@fluidframework/container-runtime": "2.0.0-dev-rc.2.0.0.245554",
84
+ "@fluidframework/container-runtime-definitions": "2.0.0-dev-rc.2.0.0.245554",
85
+ "@fluidframework/core-interfaces": "2.0.0-dev-rc.2.0.0.245554",
86
+ "@fluidframework/core-utils": "2.0.0-dev-rc.2.0.0.245554",
87
+ "@fluidframework/datastore": "2.0.0-dev-rc.2.0.0.245554",
88
+ "@fluidframework/datastore-definitions": "2.0.0-dev-rc.2.0.0.245554",
89
+ "@fluidframework/driver-definitions": "2.0.0-dev-rc.2.0.0.245554",
90
+ "@fluidframework/driver-utils": "2.0.0-dev-rc.2.0.0.245554",
91
+ "@fluidframework/local-driver": "2.0.0-dev-rc.2.0.0.245554",
92
+ "@fluidframework/map": "2.0.0-dev-rc.2.0.0.245554",
93
+ "@fluidframework/protocol-definitions": "^3.2.0",
94
+ "@fluidframework/request-handler": "2.0.0-dev-rc.2.0.0.245554",
95
+ "@fluidframework/routerlicious-driver": "2.0.0-dev-rc.2.0.0.245554",
96
+ "@fluidframework/runtime-definitions": "2.0.0-dev-rc.2.0.0.245554",
97
+ "@fluidframework/runtime-utils": "2.0.0-dev-rc.2.0.0.245554",
98
+ "@fluidframework/telemetry-utils": "2.0.0-dev-rc.2.0.0.245554",
99
+ "@fluidframework/test-driver-definitions": "2.0.0-dev-rc.2.0.0.245554",
58
100
  "best-random": "^1.0.0",
59
101
  "debug": "^4.3.4",
102
+ "mocha": "^10.2.0",
60
103
  "uuid": "^9.0.0"
61
104
  },
62
105
  "devDependencies": {
63
106
  "@arethetypeswrong/cli": "^0.13.3",
64
- "@fluid-tools/build-cli": "^0.29.0",
107
+ "@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.2.0.0.245554",
108
+ "@fluid-tools/build-cli": "^0.34.0",
65
109
  "@fluidframework/build-common": "^2.0.3",
66
- "@fluidframework/build-tools": "^0.29.0",
67
- "@fluidframework/eslint-config-fluid": "^3.3.0",
68
- "@fluidframework/mocha-test-setup": "2.0.0-dev-rc.1.0.0.232845",
110
+ "@fluidframework/build-tools": "^0.34.0",
111
+ "@fluidframework/eslint-config-fluid": "^5.1.0",
69
112
  "@fluidframework/test-utils-previous": "npm:@fluidframework/test-utils@2.0.0-internal.8.0.0",
70
- "@microsoft/api-extractor": "^7.39.1",
113
+ "@microsoft/api-extractor": "^7.42.3",
71
114
  "@types/debug": "^4.1.5",
72
115
  "@types/diff": "^3.5.1",
73
116
  "@types/mocha": "^9.1.1",
@@ -77,8 +120,7 @@
77
120
  "copyfiles": "^2.4.1",
78
121
  "cross-env": "^7.0.3",
79
122
  "diff": "^3.5.0",
80
- "eslint": "~8.50.0",
81
- "mocha": "^10.2.0",
123
+ "eslint": "~8.55.0",
82
124
  "mocha-json-output-reporter": "^2.0.1",
83
125
  "mocha-multi-reporters": "^1.5.1",
84
126
  "moment": "^2.21.0",
@@ -91,7 +133,8 @@
91
133
  "build:docs": {
92
134
  "dependsOn": [
93
135
  "...",
94
- "api-extractor:commonjs"
136
+ "api-extractor:commonjs",
137
+ "api-extractor:esnext"
95
138
  ],
96
139
  "script": false
97
140
  }
@@ -102,19 +145,36 @@
102
145
  "RemovedVariableDeclaration_mockConfigProvider": {
103
146
  "forwardCompat": false,
104
147
  "backCompat": false
148
+ },
149
+ "ClassDeclaration_TestObjectProvider": {
150
+ "forwardCompat": false
151
+ },
152
+ "ClassDeclaration_TestObjectProviderWithVersionedLoad": {
153
+ "forwardCompat": false
154
+ },
155
+ "InterfaceDeclaration_ITestObjectProvider": {
156
+ "forwardCompat": false
157
+ },
158
+ "InterfaceDeclaration_ITestContainerConfig": {
159
+ "forwardCompat": false,
160
+ "backCompat": false
105
161
  }
106
162
  }
107
163
  },
108
164
  "scripts": {
109
165
  "api": "fluid-build . --task api",
110
- "api-extractor:commonjs": "api-extractor run --local",
166
+ "api-extractor:commonjs": "api-extractor run --config ./api-extractor-cjs.json",
167
+ "api-extractor:esnext": "api-extractor run --local",
111
168
  "build": "fluid-build . --task build",
112
169
  "build:compile": "fluid-build . --task compile",
113
170
  "build:compile:min": "npm run build:compile",
114
171
  "build:docs": "fluid-build . --task api",
172
+ "build:esnext": "tsc --project ./tsconfig.json",
115
173
  "build:genver": "gen-version",
116
- "build:test": "tsc --project ./src/test/tsconfig.json",
117
- "check:are-the-types-wrong": "attw --pack",
174
+ "build:test": "npm run build:test:esm && npm run build:test:cjs",
175
+ "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
176
+ "build:test:esm": "tsc --project ./src/test/tsconfig.json",
177
+ "check:are-the-types-wrong": "attw --pack . --entrypoints .",
118
178
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
119
179
  "ci:build:docs": "api-extractor run",
120
180
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
@@ -126,9 +186,11 @@
126
186
  "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
127
187
  "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
128
188
  "test": "npm run test:mocha",
129
- "test:mocha": "mocha --recursive \"dist/test/*.spec.*js\" --exit --project src/test/tsconfig.json -r node_modules/@fluidframework/mocha-test-setup",
189
+ "test:mocha": "npm run test:mocha:esm && echo skipping cjs to avoid overhead - npm run test:mocha:cjs",
190
+ "test:mocha:cjs": "mocha --recursive \"dist/test/**/*.spec.*js\" --exit",
191
+ "test:mocha:esm": "mocha --recursive \"lib/test/**/*.spec.*js\" --exit",
130
192
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
131
- "tsc": "tsc",
193
+ "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
132
194
  "typetests:gen": "fluid-type-test-generator",
133
195
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
134
196
  }
@@ -14,6 +14,7 @@ import {
14
14
  import { ISummaryTree } from "@fluidframework/protocol-definitions";
15
15
 
16
16
  /**
17
+ * @deprecated - unused
17
18
  * Wraps the given IDocumentStorageService to override the `uploadSummaryWithContext` method. It calls the
18
19
  * `uploadSummaryCb` whenever a summary is uploaded by the client. The summary context can be updated in the
19
20
  * callback before it is uploaded to the server.
@@ -35,6 +36,7 @@ export function wrapDocumentStorageService(
35
36
  }
36
37
 
37
38
  /**
39
+ * @deprecated - unused
38
40
  * Wraps the given IDocumentService to override the `connectToStorage` method. The intent is to plumb the
39
41
  * `uploadSummaryCb` to the IDocumentStorageService so that it is called whenever a summary is uploaded by
40
42
  * the client.
@@ -55,6 +57,7 @@ export function wrapDocumentService(
55
57
  }
56
58
 
57
59
  /**
60
+ * @deprecated - unused
58
61
  * Wraps the given IDocumentServiceFactory to override the `createDocumentService` method. The intent is to plumb
59
62
  * the `uploadSummaryCb` all the way to the IDocumentStorageService so that it is called whenever a summary is
60
63
  * uploaded by the client.