@fluidframework/test-utils 2.0.0-dev.3.1.0.125672 → 2.0.0-dev.4.2.0.153917
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.
- package/CHANGELOG.md +5 -0
- package/dist/TestConfigs.d.ts.map +1 -1
- package/dist/TestConfigs.js +0 -2
- package/dist/TestConfigs.js.map +1 -1
- package/dist/TestSummaryUtils.d.ts +14 -3
- package/dist/TestSummaryUtils.d.ts.map +1 -1
- package/dist/TestSummaryUtils.js +24 -16
- package/dist/TestSummaryUtils.js.map +1 -1
- package/dist/containerUtils.d.ts +10 -19
- package/dist/containerUtils.d.ts.map +1 -1
- package/dist/containerUtils.js +12 -25
- package/dist/containerUtils.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/loaderContainerTracker.d.ts +30 -15
- package/dist/loaderContainerTracker.d.ts.map +1 -1
- package/dist/loaderContainerTracker.js +138 -58
- package/dist/loaderContainerTracker.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/testObjectProvider.d.ts +7 -1
- package/dist/testObjectProvider.d.ts.map +1 -1
- package/dist/testObjectProvider.js +44 -15
- package/dist/testObjectProvider.js.map +1 -1
- package/dist/timeoutUtils.d.ts +0 -2
- package/dist/timeoutUtils.d.ts.map +1 -1
- package/dist/timeoutUtils.js +1 -7
- package/dist/timeoutUtils.js.map +1 -1
- package/package.json +62 -63
- package/src/TestConfigs.ts +0 -2
- package/src/TestSummaryUtils.ts +23 -30
- package/src/containerUtils.ts +12 -25
- package/src/index.ts +2 -7
- package/src/loaderContainerTracker.ts +174 -72
- package/src/packageVersion.ts +1 -1
- package/src/testObjectProvider.ts +72 -16
- package/src/timeoutUtils.ts +0 -7
package/CHANGELOG.md
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestConfigs.d.ts","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEnF,eAAO,MAAM,kBAAkB,cACpB,OAAO,MAAM,EAAE,WAAW,CAAC,KACnC,
|
|
1
|
+
{"version":3,"file":"TestConfigs.d.ts","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEnF,eAAO,MAAM,kBAAkB,cACpB,OAAO,MAAM,EAAE,WAAW,CAAC,KACnC,mBAIF,CAAC"}
|
package/dist/TestConfigs.js
CHANGED
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.mockConfigProvider = void 0;
|
|
8
8
|
const mockConfigProvider = (settings = {}) => {
|
|
9
|
-
settings["Fluid.GarbageCollection.TrackGCState"] = "true";
|
|
10
|
-
settings["Fluid.GarbageCollection.WriteDataAtRoot"] = "true";
|
|
11
9
|
return {
|
|
12
10
|
getRawConfig: (name) => settings[name],
|
|
13
11
|
};
|
package/dist/TestConfigs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestConfigs.js","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAII,MAAM,kBAAkB,GAAG,CACjC,WAAwC,EAAE,EACpB,EAAE;IACxB,
|
|
1
|
+
{"version":3,"file":"TestConfigs.js","sourceRoot":"","sources":["../src/TestConfigs.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAII,MAAM,kBAAkB,GAAG,CACjC,WAAwC,EAAE,EACpB,EAAE;IACxB,OAAO;QACN,YAAY,EAAE,CAAC,IAAY,EAAe,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;KAC3D,CAAC;AACH,CAAC,CAAC;AANW,QAAA,kBAAkB,sBAM7B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ConfigTypes, IConfigProviderBase } from \"@fluidframework/telemetry-utils\";\n\nexport const mockConfigProvider = (\n\tsettings: Record<string, ConfigTypes> = {},\n): IConfigProviderBase => {\n\treturn {\n\t\tgetRawConfig: (name: string): ConfigTypes => settings[name],\n\t};\n};\n"]}
|
|
@@ -9,9 +9,20 @@ import { IFluidDataStoreFactory, NamedFluidDataStoreRegistryEntries } from "@flu
|
|
|
9
9
|
import { IConfigProviderBase } from "@fluidframework/telemetry-utils";
|
|
10
10
|
import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
|
|
11
11
|
import { ITestObjectProvider } from "./testObjectProvider";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Creates a summarizer client from the given container and data store factory, and returns the summarizer client's
|
|
14
|
+
* IContainer and ISummarizer.
|
|
15
|
+
* The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createSummarizerFromFactory(provider: ITestObjectProvider, container: IContainer, dataStoreFactory: IFluidDataStoreFactory, summaryVersion?: string, containerRuntimeFactoryType?: typeof ContainerRuntimeFactoryWithDefaultDataStore, registryEntries?: NamedFluidDataStoreRegistryEntries, logger?: ITelemetryBaseLogger): Promise<{
|
|
18
|
+
container: IContainer;
|
|
19
|
+
summarizer: ISummarizer;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a summarizer client from the given container and returns the summarizer client's IContainer and ISummarizer.
|
|
23
|
+
* The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createSummarizer(provider: ITestObjectProvider, container: IContainer, summaryVersion?: string, gcOptions?: IGCRuntimeOptions, configProvider?: IConfigProviderBase, logger?: ITelemetryBaseLogger): Promise<{
|
|
15
26
|
container: IContainer;
|
|
16
27
|
summarizer: ISummarizer;
|
|
17
28
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestSummaryUtils.d.ts","sourceRoot":"","sources":["../src/TestSummaryUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2CAA2C,EAAE,MAAM,0BAA0B,CAAC;AAEvF,OAAO,EAAE,UAAU,EAA6B,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EACN,iBAAiB,EACjB,WAAW,EAEX,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAEN,sBAAsB,EACtB,kCAAkC,EAClC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAwB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"TestSummaryUtils.d.ts","sourceRoot":"","sources":["../src/TestSummaryUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2CAA2C,EAAE,MAAM,0BAA0B,CAAC;AAEvF,OAAO,EAAE,UAAU,EAA6B,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EACN,iBAAiB,EACjB,WAAW,EAEX,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAEN,sBAAsB,EACtB,kCAAkC,EAClC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAwB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAwDjF;;;;GAIG;AACH,wBAAsB,2BAA2B,CAChD,QAAQ,EAAE,mBAAmB,EAC7B,SAAS,EAAE,UAAU,EACrB,gBAAgB,EAAE,sBAAsB,EACxC,cAAc,CAAC,EAAE,MAAM,EACvB,2BAA2B,qDAA8C,EACzE,eAAe,CAAC,EAAE,kCAAkC,EACpD,MAAM,CAAC,EAAE,oBAAoB,GAC3B,OAAO,CAAC;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,WAAW,CAAA;CAAE,CAAC,CAgB7D;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACrC,QAAQ,EAAE,mBAAmB,EAC7B,SAAS,EAAE,UAAU,EACrB,cAAc,CAAC,EAAE,MAAM,EACvB,SAAS,CAAC,EAAE,iBAAiB,EAC7B,cAAc,GAAE,mBAA0C,EAC1D,MAAM,CAAC,EAAE,oBAAoB,GAC3B,OAAO,CAAC;IAAE,SAAS,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,WAAW,CAAA;CAAE,CAAC,CAU7D;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAAC,UAAU,EAAE,WAAW,EAAE,MAAM,GAAE,MAA0B;;;;GAwB7F"}
|
package/dist/TestSummaryUtils.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.summarizeNow = exports.
|
|
7
|
+
exports.summarizeNow = exports.createSummarizer = exports.createSummarizerFromFactory = void 0;
|
|
8
8
|
const aqueduct_1 = require("@fluidframework/aqueduct");
|
|
9
9
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
10
10
|
const container_definitions_1 = require("@fluidframework/container-definitions");
|
|
@@ -14,7 +14,9 @@ const TestConfigs_1 = require("./TestConfigs");
|
|
|
14
14
|
const containerUtils_1 = require("./containerUtils");
|
|
15
15
|
const timeoutUtils_1 = require("./timeoutUtils");
|
|
16
16
|
const summarizerClientType = "summarizer";
|
|
17
|
-
async function createSummarizerCore(
|
|
17
|
+
async function createSummarizerCore(container, loader, summaryVersion) {
|
|
18
|
+
var _a;
|
|
19
|
+
const absoluteUrl = await container.getAbsoluteUrl("");
|
|
18
20
|
if (absoluteUrl === undefined) {
|
|
19
21
|
throw new Error("URL could not be resolved");
|
|
20
22
|
}
|
|
@@ -32,10 +34,12 @@ async function createSummarizerCore(absoluteUrl, loader, summaryVersion) {
|
|
|
32
34
|
};
|
|
33
35
|
const summarizerContainer = await loader.resolve(request);
|
|
34
36
|
await (0, containerUtils_1.waitForContainerConnection)(summarizerContainer);
|
|
35
|
-
const fluidObject =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
const fluidObject = summarizerContainer.getEntryPoint
|
|
38
|
+
? await ((_a = summarizerContainer.getEntryPoint) === null || _a === void 0 ? void 0 : _a.call(summarizerContainer))
|
|
39
|
+
: await (0, runtime_utils_1.requestFluidObject)(summarizerContainer, {
|
|
40
|
+
url: "_summarizer",
|
|
41
|
+
});
|
|
42
|
+
if ((fluidObject === null || fluidObject === void 0 ? void 0 : fluidObject.ISummarizer) === undefined) {
|
|
39
43
|
throw new Error("Fluid object does not implement ISummarizer");
|
|
40
44
|
}
|
|
41
45
|
return {
|
|
@@ -51,22 +55,26 @@ const defaultSummaryOptions = {
|
|
|
51
55
|
initialSummarizerDelayMs: 0,
|
|
52
56
|
},
|
|
53
57
|
};
|
|
54
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Creates a summarizer client from the given container and data store factory, and returns the summarizer client's
|
|
60
|
+
* IContainer and ISummarizer.
|
|
61
|
+
* The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
|
|
62
|
+
*/
|
|
63
|
+
async function createSummarizerFromFactory(provider, container, dataStoreFactory, summaryVersion, containerRuntimeFactoryType = aqueduct_1.ContainerRuntimeFactoryWithDefaultDataStore, registryEntries, logger) {
|
|
55
64
|
const innerRequestHandler = async (request, runtime) => runtime.IFluidHandleContext.resolveHandle(request);
|
|
56
65
|
const runtimeFactory = new containerRuntimeFactoryType(dataStoreFactory, registryEntries !== null && registryEntries !== void 0 ? registryEntries : [[dataStoreFactory.type, Promise.resolve(dataStoreFactory)]], undefined, [innerRequestHandler], { summaryOptions: defaultSummaryOptions });
|
|
57
66
|
const loader = provider.createLoader([[provider.defaultCodeDetails, runtimeFactory]], {
|
|
58
67
|
configProvider: (0, TestConfigs_1.mockConfigProvider)(),
|
|
68
|
+
logger,
|
|
59
69
|
});
|
|
60
|
-
|
|
61
|
-
return (await createSummarizerCore(absoluteUrl, loader, summaryVersion)).summarizer;
|
|
70
|
+
return createSummarizerCore(container, loader, summaryVersion);
|
|
62
71
|
}
|
|
63
72
|
exports.createSummarizerFromFactory = createSummarizerFromFactory;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a summarizer client from the given container and returns the summarizer client's IContainer and ISummarizer.
|
|
75
|
+
* The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.
|
|
76
|
+
*/
|
|
64
77
|
async function createSummarizer(provider, container, summaryVersion, gcOptions, configProvider = (0, TestConfigs_1.mockConfigProvider)(), logger) {
|
|
65
|
-
const absoluteUrl = await container.getAbsoluteUrl("");
|
|
66
|
-
return (await createSummarizerWithContainer(provider, absoluteUrl, summaryVersion, gcOptions, configProvider, logger)).summarizer;
|
|
67
|
-
}
|
|
68
|
-
exports.createSummarizer = createSummarizer;
|
|
69
|
-
async function createSummarizerWithContainer(provider, absoluteUrl, summaryVersion, gcOptions, configProvider = (0, TestConfigs_1.mockConfigProvider)(), logger) {
|
|
70
78
|
const testContainerConfig = {
|
|
71
79
|
runtimeOptions: {
|
|
72
80
|
summaryOptions: defaultSummaryOptions,
|
|
@@ -75,9 +83,9 @@ async function createSummarizerWithContainer(provider, absoluteUrl, summaryVersi
|
|
|
75
83
|
loaderProps: { configProvider, logger },
|
|
76
84
|
};
|
|
77
85
|
const loader = provider.makeTestLoader(testContainerConfig);
|
|
78
|
-
return createSummarizerCore(
|
|
86
|
+
return createSummarizerCore(container, loader, summaryVersion);
|
|
79
87
|
}
|
|
80
|
-
exports.
|
|
88
|
+
exports.createSummarizer = createSummarizer;
|
|
81
89
|
/**
|
|
82
90
|
* Summarizes on demand and returns the summary tree, the version number and the reference sequence number of the
|
|
83
91
|
* submitted summary.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestSummaryUtils.js","sourceRoot":"","sources":["../src/TestSummaryUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAuF;AACvF,+DAAsD;AACtD,iFAA8F;AAO9F,2EAAkE;AAMlE,iEAAmE;AAInE,+CAAmD;AACnD,qDAA8D;AAC9D,iDAA8C;AAE9C,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAE1C,KAAK,UAAU,oBAAoB,CAClC,
|
|
1
|
+
{"version":3,"file":"TestSummaryUtils.js","sourceRoot":"","sources":["../src/TestSummaryUtils.ts"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ContainerRuntimeFactoryWithDefaultDataStore } from \"@fluidframework/aqueduct\";\nimport { assert } from \"@fluidframework/common-utils\";\nimport { IContainer, IHostLoader, LoaderHeader } from \"@fluidframework/container-definitions\";\nimport {\n\tIGCRuntimeOptions,\n\tISummarizer,\n\tISummaryRuntimeOptions,\n} from \"@fluidframework/container-runtime\";\nimport { FluidObject, IRequest } from \"@fluidframework/core-interfaces\";\nimport { DriverHeader } from \"@fluidframework/driver-definitions\";\nimport {\n\tIContainerRuntimeBase,\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\nimport { requestFluidObject } from \"@fluidframework/runtime-utils\";\nimport { IConfigProviderBase } from \"@fluidframework/telemetry-utils\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/common-definitions\";\nimport { ITestContainerConfig, ITestObjectProvider } from \"./testObjectProvider\";\nimport { mockConfigProvider } from \"./TestConfigs\";\nimport { waitForContainerConnection } from \"./containerUtils\";\nimport { timeoutAwait } from \"./timeoutUtils\";\n\nconst summarizerClientType = \"summarizer\";\n\nasync function createSummarizerCore(\n\tcontainer: IContainer,\n\tloader: IHostLoader,\n\tsummaryVersion?: string,\n) {\n\tconst absoluteUrl = await container.getAbsoluteUrl(\"\");\n\tif (absoluteUrl === undefined) {\n\t\tthrow new Error(\"URL could not be resolved\");\n\t}\n\n\tconst request: IRequest = {\n\t\theaders: {\n\t\t\t[LoaderHeader.cache]: false,\n\t\t\t[LoaderHeader.clientDetails]: {\n\t\t\t\tcapabilities: { interactive: false },\n\t\t\t\ttype: summarizerClientType,\n\t\t\t},\n\t\t\t[DriverHeader.summarizingClient]: true,\n\t\t\t[LoaderHeader.version]: summaryVersion,\n\t\t},\n\t\turl: absoluteUrl,\n\t};\n\tconst summarizerContainer = await loader.resolve(request);\n\tawait waitForContainerConnection(summarizerContainer);\n\n\tconst fluidObject: FluidObject<ISummarizer> | undefined = summarizerContainer.getEntryPoint\n\t\t? await summarizerContainer.getEntryPoint?.()\n\t\t: await requestFluidObject<FluidObject<ISummarizer>>(summarizerContainer, {\n\t\t\t\turl: \"_summarizer\",\n\t\t });\n\tif (fluidObject?.ISummarizer === undefined) {\n\t\tthrow new Error(\"Fluid object does not implement ISummarizer\");\n\t}\n\n\treturn {\n\t\tcontainer: summarizerContainer,\n\t\tsummarizer: fluidObject.ISummarizer,\n\t};\n}\n\nconst defaultSummaryOptions: ISummaryRuntimeOptions = {\n\tsummaryConfigOverrides: {\n\t\tstate: \"disableHeuristics\",\n\t\tmaxAckWaitTime: 10000,\n\t\tmaxOpsSinceLastSummary: 7000,\n\t\tinitialSummarizerDelayMs: 0,\n\t},\n};\n\n/**\n * Creates a summarizer client from the given container and data store factory, and returns the summarizer client's\n * IContainer and ISummarizer.\n * The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.\n */\nexport async function createSummarizerFromFactory(\n\tprovider: ITestObjectProvider,\n\tcontainer: IContainer,\n\tdataStoreFactory: IFluidDataStoreFactory,\n\tsummaryVersion?: string,\n\tcontainerRuntimeFactoryType = ContainerRuntimeFactoryWithDefaultDataStore,\n\tregistryEntries?: NamedFluidDataStoreRegistryEntries,\n\tlogger?: ITelemetryBaseLogger,\n): Promise<{ container: IContainer; summarizer: ISummarizer }> {\n\tconst innerRequestHandler = async (request: IRequest, runtime: IContainerRuntimeBase) =>\n\t\truntime.IFluidHandleContext.resolveHandle(request);\n\tconst runtimeFactory = new containerRuntimeFactoryType(\n\t\tdataStoreFactory,\n\t\tregistryEntries ?? [[dataStoreFactory.type, Promise.resolve(dataStoreFactory)]],\n\t\tundefined,\n\t\t[innerRequestHandler],\n\t\t{ summaryOptions: defaultSummaryOptions },\n\t);\n\n\tconst loader = provider.createLoader([[provider.defaultCodeDetails, runtimeFactory]], {\n\t\tconfigProvider: mockConfigProvider(),\n\t\tlogger,\n\t});\n\treturn createSummarizerCore(container, loader, summaryVersion);\n}\n\n/**\n * Creates a summarizer client from the given container and returns the summarizer client's IContainer and ISummarizer.\n * The ISummarizer can be used to generate on-demand summaries. The IContainer can be used to fetch data stores, etc.\n */\nexport async function createSummarizer(\n\tprovider: ITestObjectProvider,\n\tcontainer: IContainer,\n\tsummaryVersion?: string,\n\tgcOptions?: IGCRuntimeOptions,\n\tconfigProvider: IConfigProviderBase = mockConfigProvider(),\n\tlogger?: ITelemetryBaseLogger,\n): Promise<{ container: IContainer; summarizer: ISummarizer }> {\n\tconst testContainerConfig: ITestContainerConfig = {\n\t\truntimeOptions: {\n\t\t\tsummaryOptions: defaultSummaryOptions,\n\t\t\tgcOptions,\n\t\t},\n\t\tloaderProps: { configProvider, logger },\n\t};\n\tconst loader = provider.makeTestLoader(testContainerConfig);\n\treturn createSummarizerCore(container, loader, summaryVersion);\n}\n\n/**\n * Summarizes on demand and returns the summary tree, the version number and the reference sequence number of the\n * submitted summary.\n */\nexport async function summarizeNow(summarizer: ISummarizer, reason: string = \"end-to-end test\") {\n\tconst result = summarizer.summarizeOnDemand({ reason });\n\n\tconst submitResult = await timeoutAwait(result.summarySubmitted);\n\tassert(submitResult.success, \"on-demand summary should submit\");\n\tassert(\n\t\tsubmitResult.data.stage === \"submit\",\n\t\t\"on-demand summary submitted data stage should be submit\",\n\t);\n\tassert(submitResult.data.summaryTree !== undefined, \"summary tree should exist\");\n\n\tconst broadcastResult = await timeoutAwait(result.summaryOpBroadcasted);\n\tassert(broadcastResult.success, \"summary op should be broadcast\");\n\n\tconst ackNackResult = await timeoutAwait(result.receivedSummaryAckOrNack);\n\tassert(ackNackResult.success, \"summary op should be acked\");\n\n\tawait new Promise((resolve) => process.nextTick(resolve));\n\n\treturn {\n\t\tsummaryTree: submitResult.data.summaryTree,\n\t\tsummaryVersion: ackNackResult.data.summaryAckOp.contents.handle,\n\t\tsummaryRefSeq: submitResult.data.referenceSequenceNumber,\n\t};\n}\n"]}
|
package/dist/containerUtils.d.ts
CHANGED
|
@@ -3,17 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IContainer } from "@fluidframework/container-definitions";
|
|
6
|
-
import { Container } from "@fluidframework/container-loader";
|
|
7
6
|
import { TimeoutWithError } from "./timeoutUtils";
|
|
8
|
-
/**
|
|
9
|
-
* Waits for the specified container to emit a 'connected' event.
|
|
10
|
-
*
|
|
11
|
-
* @deprecated Use waitForContainerConnection instead.
|
|
12
|
-
* Note that an upcoming release will change the default parameters on that function to:
|
|
13
|
-
* - failOnContainerClose = true
|
|
14
|
-
* - timeoutOptions.durationMs = 1s
|
|
15
|
-
*/
|
|
16
|
-
export declare function ensureContainerConnected(container: Container): Promise<void>;
|
|
17
7
|
/**
|
|
18
8
|
* Utility function to wait for the specified Container to be in Connected state.
|
|
19
9
|
* If the Container is already connected, the Promise returns immediately; otherwise it resolves when the Container emits
|
|
@@ -23,16 +13,17 @@ export declare function ensureContainerConnected(container: Container): Promise<
|
|
|
23
13
|
* @param container - The container to wait for.
|
|
24
14
|
* @param failOnContainerClose - If true, the returned Promise will be rejected if the container emits a 'closed' event
|
|
25
15
|
* before a 'connected' event.
|
|
26
|
-
* Defaults to
|
|
16
|
+
* Defaults to true.
|
|
27
17
|
* @param timeoutOptions - Options related to the behavior of the timeout.
|
|
28
|
-
* If
|
|
29
|
-
* 'connected' (or 'closed, if
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* timeoutOptions.durationMs
|
|
18
|
+
* If provided, the returned Promise will reject if the container hasn't emitted relevant events in timeoutOptions.durationMs.
|
|
19
|
+
* If not provided, the Promise will wait indefinitely for the Container to emit its 'connected' (or 'closed', if
|
|
20
|
+
* failOnContainerClose === true) event.
|
|
21
|
+
*
|
|
22
|
+
* @returns A Promise that either:
|
|
23
|
+
* - Resolves when the specified container emits a 'connected' event (or immediately if the Container is already connected).
|
|
24
|
+
* - Rejects if failOnContainerClose === true and the container emits a 'closed' event before a 'connected' event.
|
|
25
|
+
* - Rejects after timeoutOptions.durationMs if timeoutOptions !== undefined and the container does not emit relevant
|
|
26
|
+
* events, within that timeframe.
|
|
36
27
|
*/
|
|
37
28
|
export declare function waitForContainerConnection(container: IContainer, failOnContainerClose?: boolean, timeoutOptions?: TimeoutWithError): Promise<void>;
|
|
38
29
|
//# sourceMappingURL=containerUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerUtils.d.ts","sourceRoot":"","sources":["../src/containerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"containerUtils.d.ts","sourceRoot":"","sources":["../src/containerUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAEnE,OAAO,EAAmC,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEnF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,0BAA0B,CAC/C,SAAS,EAAE,UAAU,EACrB,oBAAoB,GAAE,OAAc,EACpC,cAAc,CAAC,EAAE,gBAAgB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAaf"}
|
package/dist/containerUtils.js
CHANGED
|
@@ -4,23 +4,9 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.waitForContainerConnection =
|
|
7
|
+
exports.waitForContainerConnection = void 0;
|
|
8
8
|
const container_loader_1 = require("@fluidframework/container-loader");
|
|
9
9
|
const timeoutUtils_1 = require("./timeoutUtils");
|
|
10
|
-
/**
|
|
11
|
-
* Waits for the specified container to emit a 'connected' event.
|
|
12
|
-
*
|
|
13
|
-
* @deprecated Use waitForContainerConnection instead.
|
|
14
|
-
* Note that an upcoming release will change the default parameters on that function to:
|
|
15
|
-
* - failOnContainerClose = true
|
|
16
|
-
* - timeoutOptions.durationMs = 1s
|
|
17
|
-
*/
|
|
18
|
-
async function ensureContainerConnected(container) {
|
|
19
|
-
if (!container.connected) {
|
|
20
|
-
return (0, timeoutUtils_1.timeoutPromise)((resolve) => container.once("connected", () => resolve()));
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.ensureContainerConnected = ensureContainerConnected;
|
|
24
10
|
/**
|
|
25
11
|
* Utility function to wait for the specified Container to be in Connected state.
|
|
26
12
|
* If the Container is already connected, the Promise returns immediately; otherwise it resolves when the Container emits
|
|
@@ -30,18 +16,19 @@ exports.ensureContainerConnected = ensureContainerConnected;
|
|
|
30
16
|
* @param container - The container to wait for.
|
|
31
17
|
* @param failOnContainerClose - If true, the returned Promise will be rejected if the container emits a 'closed' event
|
|
32
18
|
* before a 'connected' event.
|
|
33
|
-
* Defaults to
|
|
19
|
+
* Defaults to true.
|
|
34
20
|
* @param timeoutOptions - Options related to the behavior of the timeout.
|
|
35
|
-
* If
|
|
36
|
-
* 'connected' (or 'closed, if
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* timeoutOptions.durationMs
|
|
21
|
+
* If provided, the returned Promise will reject if the container hasn't emitted relevant events in timeoutOptions.durationMs.
|
|
22
|
+
* If not provided, the Promise will wait indefinitely for the Container to emit its 'connected' (or 'closed', if
|
|
23
|
+
* failOnContainerClose === true) event.
|
|
24
|
+
*
|
|
25
|
+
* @returns A Promise that either:
|
|
26
|
+
* - Resolves when the specified container emits a 'connected' event (or immediately if the Container is already connected).
|
|
27
|
+
* - Rejects if failOnContainerClose === true and the container emits a 'closed' event before a 'connected' event.
|
|
28
|
+
* - Rejects after timeoutOptions.durationMs if timeoutOptions !== undefined and the container does not emit relevant
|
|
29
|
+
* events, within that timeframe.
|
|
43
30
|
*/
|
|
44
|
-
async function waitForContainerConnection(container, failOnContainerClose =
|
|
31
|
+
async function waitForContainerConnection(container, failOnContainerClose = true, timeoutOptions) {
|
|
45
32
|
if (container.connectionState !== container_loader_1.ConnectionState.Connected) {
|
|
46
33
|
const executor = (resolve, reject) => {
|
|
47
34
|
container.once("connected", () => resolve());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerUtils.js","sourceRoot":"","sources":["../src/containerUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,
|
|
1
|
+
{"version":3,"file":"containerUtils.js","sourceRoot":"","sources":["../src/containerUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,uEAAmE;AACnE,iDAAmF;AAEnF;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,KAAK,UAAU,0BAA0B,CAC/C,SAAqB,EACrB,uBAAgC,IAAI,EACpC,cAAiC;IAEjC,IAAI,SAAS,CAAC,eAAe,KAAK,kCAAe,CAAC,SAAS,EAAE;QAC5D,MAAM,QAAQ,GAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrD,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7C,IAAI,oBAAoB,EAAE;gBACzB,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;aACnD;QACF,CAAC,CAAC;QAEF,OAAO,cAAc,KAAK,SAAS;YAClC,CAAC,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC;YACvB,CAAC,CAAC,IAAA,6BAAc,EAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;KAC5C;AACF,CAAC;AAjBD,gEAiBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IContainer } from \"@fluidframework/container-definitions\";\nimport { ConnectionState } from \"@fluidframework/container-loader\";\nimport { PromiseExecutor, timeoutPromise, TimeoutWithError } from \"./timeoutUtils\";\n\n/**\n * Utility function to wait for the specified Container to be in Connected state.\n * If the Container is already connected, the Promise returns immediately; otherwise it resolves when the Container emits\n * its 'connected' event.\n * If failOnContainerClose === true, the returned Promise will be rejected if the container emits a 'closed' event\n * before a 'connected' event.\n * @param container - The container to wait for.\n * @param failOnContainerClose - If true, the returned Promise will be rejected if the container emits a 'closed' event\n * before a 'connected' event.\n * Defaults to true.\n * @param timeoutOptions - Options related to the behavior of the timeout.\n * If provided, the returned Promise will reject if the container hasn't emitted relevant events in timeoutOptions.durationMs.\n * If not provided, the Promise will wait indefinitely for the Container to emit its 'connected' (or 'closed', if\n * failOnContainerClose === true) event.\n *\n * @returns A Promise that either:\n * - Resolves when the specified container emits a 'connected' event (or immediately if the Container is already connected).\n * - Rejects if failOnContainerClose === true and the container emits a 'closed' event before a 'connected' event.\n * - Rejects after timeoutOptions.durationMs if timeoutOptions !== undefined and the container does not emit relevant\n * events, within that timeframe.\n */\nexport async function waitForContainerConnection(\n\tcontainer: IContainer,\n\tfailOnContainerClose: boolean = true,\n\ttimeoutOptions?: TimeoutWithError,\n): Promise<void> {\n\tif (container.connectionState !== ConnectionState.Connected) {\n\t\tconst executor: PromiseExecutor = (resolve, reject) => {\n\t\t\tcontainer.once(\"connected\", () => resolve());\n\t\t\tif (failOnContainerClose) {\n\t\t\t\tcontainer.once(\"closed\", (error) => reject(error));\n\t\t\t}\n\t\t};\n\n\t\treturn timeoutOptions === undefined\n\t\t\t? new Promise(executor)\n\t\t\t: timeoutPromise(executor, timeoutOptions);\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { mockConfigProvider } from "./TestConfigs";
|
|
|
12
12
|
export { createTestContainerRuntimeFactory, TestContainerRuntimeFactory, } from "./testContainerRuntimeFactory";
|
|
13
13
|
export { ChannelFactoryRegistry, TestFluidObject, TestFluidObjectFactory } from "./testFluidObject";
|
|
14
14
|
export { createDocumentId, DataObjectFactoryType, EventAndErrorTrackingLogger, getUnexpectedLogErrorException, IOpProcessingController, ITestContainerConfig, ITestObjectProvider, TestObjectProvider, } from "./testObjectProvider";
|
|
15
|
-
export { createSummarizer, createSummarizerFromFactory,
|
|
15
|
+
export { createSummarizer, createSummarizerFromFactory, summarizeNow } from "./TestSummaryUtils";
|
|
16
16
|
export { defaultTimeoutDurationMs, timeoutAwait, timeoutPromise, TimeoutWithError, TimeoutWithValue, } from "./timeoutUtils";
|
|
17
|
-
export {
|
|
17
|
+
export { waitForContainerConnection } from "./containerUtils";
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACN,iCAAiC,EACjC,2BAA2B,GAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EACN,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,EAC3B,8BAA8B,EAC9B,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACN,iCAAiC,EACjC,2BAA2B,GAC3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,EACN,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,EAC3B,8BAA8B,EAC9B,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EACN,wBAAwB,EACxB,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.waitForContainerConnection = exports.
|
|
7
|
+
exports.waitForContainerConnection = exports.timeoutPromise = exports.timeoutAwait = exports.defaultTimeoutDurationMs = exports.summarizeNow = exports.createSummarizerFromFactory = exports.createSummarizer = exports.TestObjectProvider = exports.getUnexpectedLogErrorException = exports.EventAndErrorTrackingLogger = exports.DataObjectFactoryType = exports.createDocumentId = exports.TestFluidObjectFactory = exports.TestFluidObject = exports.TestContainerRuntimeFactory = exports.createTestContainerRuntimeFactory = exports.mockConfigProvider = exports.retryWithEventualValue = exports.createLoader = exports.createAndAttachContainer = exports.LocalCodeLoader = exports.LoaderContainerTracker = exports.wrapDocumentStorageService = exports.wrapDocumentServiceFactory = exports.wrapDocumentService = void 0;
|
|
8
8
|
var DriverWrappers_1 = require("./DriverWrappers");
|
|
9
9
|
Object.defineProperty(exports, "wrapDocumentService", { enumerable: true, get: function () { return DriverWrappers_1.wrapDocumentService; } });
|
|
10
10
|
Object.defineProperty(exports, "wrapDocumentServiceFactory", { enumerable: true, get: function () { return DriverWrappers_1.wrapDocumentServiceFactory; } });
|
|
@@ -35,13 +35,11 @@ Object.defineProperty(exports, "TestObjectProvider", { enumerable: true, get: fu
|
|
|
35
35
|
var TestSummaryUtils_1 = require("./TestSummaryUtils");
|
|
36
36
|
Object.defineProperty(exports, "createSummarizer", { enumerable: true, get: function () { return TestSummaryUtils_1.createSummarizer; } });
|
|
37
37
|
Object.defineProperty(exports, "createSummarizerFromFactory", { enumerable: true, get: function () { return TestSummaryUtils_1.createSummarizerFromFactory; } });
|
|
38
|
-
Object.defineProperty(exports, "createSummarizerWithContainer", { enumerable: true, get: function () { return TestSummaryUtils_1.createSummarizerWithContainer; } });
|
|
39
38
|
Object.defineProperty(exports, "summarizeNow", { enumerable: true, get: function () { return TestSummaryUtils_1.summarizeNow; } });
|
|
40
39
|
var timeoutUtils_1 = require("./timeoutUtils");
|
|
41
40
|
Object.defineProperty(exports, "defaultTimeoutDurationMs", { enumerable: true, get: function () { return timeoutUtils_1.defaultTimeoutDurationMs; } });
|
|
42
41
|
Object.defineProperty(exports, "timeoutAwait", { enumerable: true, get: function () { return timeoutUtils_1.timeoutAwait; } });
|
|
43
42
|
Object.defineProperty(exports, "timeoutPromise", { enumerable: true, get: function () { return timeoutUtils_1.timeoutPromise; } });
|
|
44
43
|
var containerUtils_1 = require("./containerUtils");
|
|
45
|
-
Object.defineProperty(exports, "ensureContainerConnected", { enumerable: true, get: function () { return containerUtils_1.ensureContainerConnected; } });
|
|
46
44
|
Object.defineProperty(exports, "waitForContainerConnection", { enumerable: true, get: function () { return containerUtils_1.waitForContainerConnection; } });
|
|
47
45
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mDAI0B;AAHzB,qHAAA,mBAAmB,OAAA;AACnB,4HAAA,0BAA0B,OAAA;AAC1B,4HAAA,0BAA0B,OAAA;AAG3B,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,qDAAgG;AAAtE,kHAAA,eAAe,OAAA;AACzC,6CAAuE;AAA9D,uHAAA,wBAAwB,OAAA;AAAE,2GAAA,YAAY,OAAA;AAC/C,iCAAiD;AAAxC,+GAAA,sBAAsB,OAAA;AAC/B,6CAAmD;AAA1C,iHAAA,kBAAkB,OAAA;AAC3B,6EAGuC;AAFtC,gJAAA,iCAAiC,OAAA;AACjC,0IAAA,2BAA2B,OAAA;AAE5B,qDAAoG;AAAnE,kHAAA,eAAe,OAAA;AAAE,yHAAA,sBAAsB,OAAA;AACxE,2DAS8B;AAR7B,sHAAA,gBAAgB,OAAA;AAChB,2HAAA,qBAAqB,OAAA;AACrB,iIAAA,2BAA2B,OAAA;AAC3B,oIAAA,8BAA8B,OAAA;AAI9B,wHAAA,kBAAkB,OAAA;AAEnB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mDAI0B;AAHzB,qHAAA,mBAAmB,OAAA;AACnB,4HAAA,0BAA0B,OAAA;AAC1B,4HAAA,0BAA0B,OAAA;AAG3B,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,qDAAgG;AAAtE,kHAAA,eAAe,OAAA;AACzC,6CAAuE;AAA9D,uHAAA,wBAAwB,OAAA;AAAE,2GAAA,YAAY,OAAA;AAC/C,iCAAiD;AAAxC,+GAAA,sBAAsB,OAAA;AAC/B,6CAAmD;AAA1C,iHAAA,kBAAkB,OAAA;AAC3B,6EAGuC;AAFtC,gJAAA,iCAAiC,OAAA;AACjC,0IAAA,2BAA2B,OAAA;AAE5B,qDAAoG;AAAnE,kHAAA,eAAe,OAAA;AAAE,yHAAA,sBAAsB,OAAA;AACxE,2DAS8B;AAR7B,sHAAA,gBAAgB,OAAA;AAChB,2HAAA,qBAAqB,OAAA;AACrB,iIAAA,2BAA2B,OAAA;AAC3B,oIAAA,8BAA8B,OAAA;AAI9B,wHAAA,kBAAkB,OAAA;AAEnB,uDAAiG;AAAxF,oHAAA,gBAAgB,OAAA;AAAE,+HAAA,2BAA2B,OAAA;AAAE,gHAAA,YAAY,OAAA;AACpE,+CAMwB;AALvB,wHAAA,wBAAwB,OAAA;AACxB,4GAAA,YAAY,OAAA;AACZ,8GAAA,cAAc,OAAA;AAIf,mDAA8D;AAArD,4HAAA,0BAA0B,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\twrapDocumentService,\n\twrapDocumentServiceFactory,\n\twrapDocumentStorageService,\n} from \"./DriverWrappers\";\nexport { IProvideTestFluidObject, ITestFluidObject } from \"./interfaces\";\nexport { LoaderContainerTracker } from \"./loaderContainerTracker\";\nexport { fluidEntryPoint, LocalCodeLoader, SupportedExportInterfaces } from \"./localCodeLoader\";\nexport { createAndAttachContainer, createLoader } from \"./localLoader\";\nexport { retryWithEventualValue } from \"./retry\";\nexport { mockConfigProvider } from \"./TestConfigs\";\nexport {\n\tcreateTestContainerRuntimeFactory,\n\tTestContainerRuntimeFactory,\n} from \"./testContainerRuntimeFactory\";\nexport { ChannelFactoryRegistry, TestFluidObject, TestFluidObjectFactory } from \"./testFluidObject\";\nexport {\n\tcreateDocumentId,\n\tDataObjectFactoryType,\n\tEventAndErrorTrackingLogger,\n\tgetUnexpectedLogErrorException,\n\tIOpProcessingController,\n\tITestContainerConfig,\n\tITestObjectProvider,\n\tTestObjectProvider,\n} from \"./testObjectProvider\";\nexport { createSummarizer, createSummarizerFromFactory, summarizeNow } from \"./TestSummaryUtils\";\nexport {\n\tdefaultTimeoutDurationMs,\n\ttimeoutAwait,\n\ttimeoutPromise,\n\tTimeoutWithError,\n\tTimeoutWithValue,\n} from \"./timeoutUtils\";\nexport { waitForContainerConnection } from \"./containerUtils\";\n"]}
|
|
@@ -29,34 +29,29 @@ export declare class LoaderContainerTracker implements IOpProcessingController {
|
|
|
29
29
|
* Reset the tracker, closing all containers and stop tracking them.
|
|
30
30
|
*/
|
|
31
31
|
reset(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Ensure all tracked containers are synchronized
|
|
34
|
-
*/
|
|
35
|
-
ensureSynchronized(...containers: IContainer[]): Promise<void>;
|
|
36
32
|
/**
|
|
37
33
|
* Ensure all tracked containers are synchronized with a time limit
|
|
34
|
+
*
|
|
35
|
+
* @deprecated - this method is equivalent to @see {@link LoaderContainerTracker.ensureSynchronized}, please configure the test timeout instead
|
|
38
36
|
*/
|
|
39
37
|
ensureSynchronizedWithTimeout?(timeoutDuration: number | undefined, ...containers: IContainer[]): Promise<void>;
|
|
40
38
|
/**
|
|
41
39
|
* Make sure all the tracked containers are synchronized.
|
|
42
40
|
*
|
|
43
41
|
* No isDirty (non-readonly) containers
|
|
44
|
-
*
|
|
45
42
|
* No extra clientId in quorum of any container that is not tracked and still opened.
|
|
46
|
-
*
|
|
47
43
|
* - i.e. no pending Join/Leave message.
|
|
48
|
-
*
|
|
49
44
|
* No unresolved proposal (minSeqNum \>= lastProposalSeqNum)
|
|
50
|
-
*
|
|
51
45
|
* lastSequenceNumber of all container is the same
|
|
52
|
-
*
|
|
53
46
|
* clientSequenceNumberObserved is the same as clientSequenceNumber sent
|
|
54
|
-
*
|
|
55
47
|
* - this overlaps with !isDirty, but include task scheduler ops.
|
|
56
|
-
*
|
|
57
48
|
* - Trailing NoOp is tracked and don't count as pending ops.
|
|
49
|
+
*
|
|
50
|
+
* Containers that are already pause will resume process and paused again once
|
|
51
|
+
* everything is synchronized. Containers that aren't paused will remain unpaused when this
|
|
52
|
+
* function returns.
|
|
58
53
|
*/
|
|
59
|
-
|
|
54
|
+
ensureSynchronized(...containers: IContainer[]): Promise<void>;
|
|
60
55
|
/**
|
|
61
56
|
* Utility to calculate the set of clientId per container in quorum that is NOT associated with
|
|
62
57
|
* any container we tracked, indicating there is a pending join or leave op that we need to wait.
|
|
@@ -70,7 +65,8 @@ export declare class LoaderContainerTracker implements IOpProcessingController {
|
|
|
70
65
|
*
|
|
71
66
|
* @param containersToApply - the set of containers to check
|
|
72
67
|
*/
|
|
73
|
-
private
|
|
68
|
+
private needSequenceNumberSynchronize;
|
|
69
|
+
private containerIndexStrings;
|
|
74
70
|
/**
|
|
75
71
|
* Utility to wait for any clientId in quorum that is NOT associated with any container we
|
|
76
72
|
* tracked, indicating there is a pending join or leave op that we need to wait.
|
|
@@ -92,18 +88,37 @@ export declare class LoaderContainerTracker implements IOpProcessingController {
|
|
|
92
88
|
/**
|
|
93
89
|
* Pause all queue activities on the containers given, or all tracked containers
|
|
94
90
|
* Any containers given that is not tracked will be ignored.
|
|
91
|
+
*
|
|
92
|
+
* When a container is paused, it is assumed that we want fine grain control over op
|
|
93
|
+
* sequencing. This function will prepare the container and force it into write mode to
|
|
94
|
+
* avoid missing join messages or change the sequence of event when switching from read to
|
|
95
|
+
* write mode.
|
|
95
96
|
*/
|
|
96
97
|
pauseProcessing(...containers: IContainer[]): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* When a container is paused, it is assumed that we want fine grain control over op
|
|
100
|
+
* sequencing. This function will prepare the container and force it into write mode to
|
|
101
|
+
* avoid missing join messages or change the sequence of event when switching from read to
|
|
102
|
+
* write mode.
|
|
103
|
+
*
|
|
104
|
+
* @param container - the container to pause
|
|
105
|
+
* @param record - the record for the container
|
|
106
|
+
*/
|
|
107
|
+
private pauseContainer;
|
|
97
108
|
/**
|
|
98
109
|
* Pause all queue activities on all tracked containers, and resume only
|
|
99
110
|
* inbound to process ops until it is idle. All queues are left in the paused state
|
|
100
|
-
* after the function
|
|
111
|
+
* after the function.
|
|
112
|
+
*
|
|
113
|
+
* Pausing will switch the container to write mode. See `pauseProcessing`
|
|
101
114
|
*/
|
|
102
115
|
processIncoming(...containers: IContainer[]): Promise<void>;
|
|
103
116
|
/**
|
|
104
117
|
* Pause all queue activities on all tracked containers, and resume only
|
|
105
118
|
* outbound to process ops until it is idle. All queues are left in the paused state
|
|
106
|
-
* after the function
|
|
119
|
+
* after the function.
|
|
120
|
+
*
|
|
121
|
+
* Pausing will switch the container to write mode. See `pauseProcessing`
|
|
107
122
|
*/
|
|
108
123
|
processOutgoing(...containers: IContainer[]): Promise<void>;
|
|
109
124
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loaderContainerTracker.d.ts","sourceRoot":"","sources":["../src/loaderContainerTracker.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAe,WAAW,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"loaderContainerTracker.d.ts","sourceRoot":"","sources":["../src/loaderContainerTracker.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAe,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAU7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAuB/D,qBAAa,sBAAuB,YAAW,uBAAuB;IAIzD,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IAHlD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA0C;IACrE,OAAO,CAAC,kBAAkB,CAAa;gBAEV,qBAAqB,GAAE,OAAe;IAEnE;;;OAGG;IACI,GAAG,CAAC,UAAU,SAAS,WAAW,EAAE,MAAM,EAAE,UAAU;IAmB7D;;;;OAIG;IACH,OAAO,CAAC,YAAY;IA2BpB;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAuC1B,OAAO,CAAC,iBAAiB;IAQzB;;OAEG;IACI,KAAK;IAUZ;;;;OAIG;IACU,6BAA6B,CAAC,CAC1C,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,GAAG,UAAU,EAAE,UAAU,EAAE;IAK5B;;;;;;;;;;;;;;;OAeG;IACU,kBAAkB,CAAC,GAAG,UAAU,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA2E3E;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IA8BzB;;;;;OAKG;IACH,OAAO,CAAC,6BAA6B;IAmErC,OAAO,CAAC,qBAAqB;IAO7B;;;;;;;OAOG;YACW,qBAAqB;IAoCnC;;;OAGG;YACW,oBAAoB;IAclC;;OAEG;IACI,gBAAgB,CAAC,GAAG,UAAU,EAAE,UAAU,EAAE;IAoBnD;;;;;;;;OAQG;IACU,eAAe,CAAC,GAAG,UAAU,EAAE,UAAU,EAAE;IAexD;;;;;;;;OAQG;YACW,cAAc;IAwD5B;;;;;;OAMG;IACU,eAAe,CAAC,GAAG,UAAU,EAAE,UAAU,EAAE;IAIxD;;;;;;OAMG;IACU,eAAe,CAAC,GAAG,UAAU,EAAE,UAAU,EAAE;IAIxD;;OAEG;YACW,YAAY;IAgD1B;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IA2BzB;;OAEG;IACH,OAAO,CAAC,UAAU;IAwElB;;;;OAIG;IACH,OAAO,CAAC,aAAa;CAKrB"}
|