Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizations for alias tests which are flaky and timeout #23996

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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 @@ -18,7 +18,7 @@ import {
ITestObjectProvider,
getContainerEntryPointBackCompat,
summarizeNow,
waitForContainerConnection,
timeoutAwait,
} from "@fluidframework/test-utils/internal";

import { TestPersistedCache } from "../testPersistedCache.js";
Expand All @@ -44,12 +44,12 @@ describeCompat("Named root data stores", "FullCompat", (getTestObjectProvider) =
let provider: ITestObjectProvider;
const testPersistedCache = new TestPersistedCache();
beforeEach("getTestObjectProvider", async () => {
provider = getTestObjectProvider({ persistedCache: testPersistedCache });
provider = getTestObjectProvider({
persistedCache: testPersistedCache,
syncSummarizer: true,
});
container1 = await provider.makeTestContainer(testContainerConfig);
dataObject1 = await getContainerEntryPointBackCompat<ITestFluidObject>(container1);
await waitForContainerConnection(container1);

await provider.ensureSynchronized();

container2 = await provider.loadTestContainer(testContainerConfig);
dataObject2 = await getContainerEntryPointBackCompat<ITestFluidObject>(container2);
Expand Down Expand Up @@ -270,12 +270,11 @@ describeCompat("Named root data stores", "FullCompat", (getTestObjectProvider) =
assert.equal(aliasResult1, "Success");
assert.equal(aliasResult2, "Conflict");

await provider.ensureSynchronized();
const container3 = await provider.loadTestContainer(testContainerConfig);
const dataObject3 = await getContainerEntryPointBackCompat<ITestFluidObject>(container3);

await provider.ensureSynchronized();
assert.ok(await getAliasedDataStoreEntryPoint(dataObject3, alias));
assert.ok(await timeoutAwait(getAliasedDataStoreEntryPoint(dataObject3, alias)));
});

it("getAliasedDataStoreEntryPoint only returns aliased data stores", async function () {
Expand Down Expand Up @@ -334,11 +333,10 @@ describeCompat("Named root data stores", "FullCompat", (getTestObjectProvider) =
assert.equal(aliasResult1, "Success");
assert.equal(aliasResult2, "Conflict");

await provider.ensureSynchronized();

const { summarizer } = await createSummarizer(provider, container1, {
fluidDataObjectType: DataObjectFactoryType.Test,
});
await provider.ensureSynchronized();
const { summaryVersion } = await summarizeNow(summarizer);

// For the ODSP driver, we need to clear the cache to ensure we get the latest snapshot
Expand All @@ -355,7 +353,7 @@ describeCompat("Named root data stores", "FullCompat", (getTestObjectProvider) =
const aliasResult3 = await ds3.trySetAlias(alias);

assert.equal(aliasResult3, "Conflict");
assert.ok(await getAliasedDataStoreEntryPoint(dataObject3, alias));
assert.ok(await timeoutAwait(getAliasedDataStoreEntryPoint(dataObject3, alias)));
},
);
});
Expand Down
Loading