Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ const testConfigs = generatePairwiseOptions({
timeoutRefreshInLoadedContainer: [true, false],
});

const timeoutMs = 100;
const realServiceTimeoutMs = 1000;

describeCompat("Refresh snapshot lifecycle", "NoCompat", (getTestObjectProvider, apis) => {
const mapId = "map";
const registry: ChannelFactoryRegistry = [[mapId, SharedMap.getFactory()]];
const configProvider = (settings: Record<string, ConfigTypes>): IConfigProviderBase => ({
getRawConfig: (name: string): ConfigTypes => settings[name],
});
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- TODO: Add explicit return type
const runtimeOptions = (idCompressorEnabled) => {
return {
summaryOptions: {
Expand Down Expand Up @@ -108,7 +110,7 @@ describeCompat("Refresh snapshot lifecycle", "NoCompat", (getTestObjectProvider,
};

for (const testConfig of testConfigs) {
it.skip(`Snapshot refresh life cycle: ${JSON.stringify(
it(`Snapshot refresh life cycle: ${JSON.stringify(
testConfig ?? "undefined",
)}`, async () => {
const provider: ITestObjectProvider = getTestObjectProvider();
Expand All @@ -127,8 +129,8 @@ describeCompat("Refresh snapshot lifecycle", "NoCompat", (getTestObjectProvider,
provider.driver.type === "local" ||
provider.driver.type === "t9s" ||
provider.driver.type === "tinylicious"
? 100
: 1000;
? timeoutMs
: realServiceTimeoutMs;
}
const getLatestSnapshotInfoP = new Deferred<void>();
const testContainerConfig = {
Expand Down Expand Up @@ -189,15 +191,15 @@ describeCompat("Refresh snapshot lifecycle", "NoCompat", (getTestObjectProvider,

if (testConfig.savedOps) {
for (let k = 0; k < 10; k++) {
map.set(`${i}`, i++);
groupIdDataObject.root.set(`${j}`, j++);
map1.set(`${i}`, i++);
groupIdDataObject1.root.set(`${j}`, j++);
}
await waitForSummary(container1);
if (testConfig.timeoutRefreshInOriginalContainer) {
await timeoutPromise((resolve) => {
setTimeout(() => {
resolve();
}, 105);
}, snapshotRefreshTimeoutMs + 10);
});
}
await provider.ensureSynchronized();
Expand All @@ -221,7 +223,9 @@ describeCompat("Refresh snapshot lifecycle", "NoCompat", (getTestObjectProvider,
assert.ok(pendingOps);

if (testConfig.summaryWhileOffline) {
map.set(`${i}`, i++);
for (let k = 0; k < 10; k++) {
map.set(`${i}`, i++);
}
await waitForSummary(container);
}

Expand Down Expand Up @@ -254,7 +258,7 @@ describeCompat("Refresh snapshot lifecycle", "NoCompat", (getTestObjectProvider,
await timeoutPromise((resolve) => {
setTimeout(() => {
resolve();
}, 105);
}, snapshotRefreshTimeoutMs + 10);
});
}
}
Expand Down
Loading