Skip to content

Commit

Permalink
Preparation for IContainerRuntimeOptions.enableGroupedBatching removal (
Browse files Browse the repository at this point in the history
#23325)

## Description

This PR is a preparation for the breaking change that will happen when
we remove IContainerRuntimeOptions.enableGroupedBatching

## Breaking Changes

Link to the breaking issue:
#[23270](#23270)

## Reviewer Guidance

- Let me know if I missed something or if there's a better solution for
what I want to accomplish

Owning Task:
[AB#26793](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/26793)
  • Loading branch information
MarioJGMsoft authored Dec 16, 2024
1 parent d86f515 commit 489c5cc
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 28 deletions.
1 change: 0 additions & 1 deletion packages/runtime/container-runtime/src/containerRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,6 @@ export class ContainerRuntime
enableGroupedBatching: true,
...runtimeOptions,
};

this.logger = createChildLogger({ logger: this.baseLogger });
this.mc = createChildMonitoringContext({
logger: this.logger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1124,14 +1124,15 @@ describe("Runtime", () => {
describe("Unrecognized types not supported", () => {
let containerRuntime: ContainerRuntime;
beforeEach(async () => {
const runtimeOptions: IContainerRuntimeOptionsInternal = {
enableGroupedBatching: false,
};
containerRuntime = await ContainerRuntime.loadRuntime({
context: getMockContext() as IContainerContext,
registryEntries: [],
existing: false,
requestHandler: undefined,
runtimeOptions: {
enableGroupedBatching: false,
},
runtimeOptions,
provideEntryPoint: mockProvideEntryPoint,
});
});
Expand Down Expand Up @@ -2588,14 +2589,15 @@ describe("Runtime", () => {
runtimes = new Map<string, ContainerRuntime>();
logger = new MockLogger();
droppedSignals = [];
const runtimeOptions: IContainerRuntimeOptionsInternal = {
enableGroupedBatching: false,
};
containerRuntime = await ContainerRuntime.loadRuntime({
context: getMockContext({ logger }) as IContainerContext,
registryEntries: [],
existing: false,
requestHandler: undefined,
runtimeOptions: {
enableGroupedBatching: false,
},
runtimeOptions,
provideEntryPoint: mockProvideEntryPoint,
});
// Assert that clientId is not undefined
Expand Down Expand Up @@ -3160,6 +3162,9 @@ describe("Runtime", () => {

beforeEach(async () => {
remoteLogger = new MockLogger();
const runtimeOptions: IContainerRuntimeOptionsInternal = {
enableGroupedBatching: false,
};
remoteContainerRuntime = await ContainerRuntime.loadRuntime({
context: getMockContext(
{ logger: remoteLogger },
Expand All @@ -3168,9 +3173,7 @@ describe("Runtime", () => {
registryEntries: [],
existing: false,
requestHandler: undefined,
runtimeOptions: {
enableGroupedBatching: false,
},
runtimeOptions,
provideEntryPoint: mockProvideEntryPoint,
});
// Assert that clientId is not undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { TypedEventEmitter } from "@fluid-internal/client-utils";
import { describeCompat, itExpects } from "@fluid-private/test-version-utils";
import {
CompressionAlgorithms,
IContainerRuntimeOptions,
type IContainerRuntimeOptionsInternal,
} from "@fluidframework/container-runtime/internal";
import { FluidErrorTypes } from "@fluidframework/core-interfaces/internal";
import {
Expand Down Expand Up @@ -47,7 +47,7 @@ async function runAndValidateBatch(
provider: ITestObjectProvider,
proxyDsf: IDocumentServiceFactory,
timeout: number,
runtimeOptions?: IContainerRuntimeOptions,
runtimeOptions?: IContainerRuntimeOptionsInternal,
) {
let containerUrl: string | undefined;
{
Expand Down
19 changes: 11 additions & 8 deletions packages/test/test-end-to-end-tests/src/test/blobs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
CompressionAlgorithms,
ContainerMessageType,
DefaultSummaryConfiguration,
type IContainerRuntimeOptionsInternal,
} from "@fluidframework/container-runtime/internal";
import { IErrorBase, IFluidHandle } from "@fluidframework/core-interfaces";
import { Deferred } from "@fluidframework/core-utils/internal";
Expand Down Expand Up @@ -244,16 +245,18 @@ describeCompat("blobs", "FullCompat", (getTestObjectProvider, apis) => {
this.skip();
}

const runtimeOptions: IContainerRuntimeOptionsInternal = {
...testContainerConfig.runtimeOptions,
compressionOptions: {
minimumBatchSizeInBytes: 1,
compressionAlgorithm: CompressionAlgorithms.lz4,
},
enableGroupedBatching,
};

const container = await provider.makeTestContainer({
...testContainerConfig,
runtimeOptions: {
...testContainerConfig.runtimeOptions,
compressionOptions: {
minimumBatchSizeInBytes: 1,
compressionAlgorithm: CompressionAlgorithms.lz4,
},
enableGroupedBatching,
},
runtimeOptions,
});

const dataStore = await getContainerEntryPointBackCompat<ITestDataObject>(container);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
import {
CompressionAlgorithms,
type IContainerRuntimeOptions,
type IContainerRuntimeOptionsInternal,
} from "@fluidframework/container-runtime/internal";
// TODO:AB#6558: This should be provided based on the compatibility configuration.
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
Expand Down Expand Up @@ -48,7 +49,7 @@ const compressionSuite = (getProvider) => {
});

async function setupContainers(
runtimeOptions: IContainerRuntimeOptions = defaultRuntimeOptions,
runtimeOptions: IContainerRuntimeOptionsInternal = defaultRuntimeOptions,
) {
const containerConfig: ITestContainerConfig = {
registry: [["mapKey", SharedMap.getFactory()]],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { Loader } from "@fluidframework/container-loader/internal";
import {
ChannelCollection,
ChannelCollectionFactory,
IContainerRuntimeOptions,
ISummarizer,
SummaryCollection,
type IContainerRuntimeOptionsInternal,
} from "@fluidframework/container-runtime/internal";
import { assert } from "@fluidframework/core-utils/internal";
import { IFluidDataStoreChannel } from "@fluidframework/runtime-definitions/internal";
Expand Down Expand Up @@ -45,7 +45,7 @@ describeCompat("Nested DataStores", "NoCompat", (getTestObjectProvider, apis) =>
let summarizer: ISummarizer | undefined;
let loader: IHostLoader | undefined;

const runtimeOptions: IContainerRuntimeOptions = {
const runtimeOptions: IContainerRuntimeOptionsInternal = {
enableGroupedBatching: true,
// Force summarizer heuristics to be disabled so we can control when to summarize
summaryOptions: {
Expand Down
6 changes: 3 additions & 3 deletions packages/test/test-utils/src/testContainerRuntimeFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IContainerContext, IRuntime } from "@fluidframework/container-definitio
import {
ContainerRuntime,
DefaultSummaryConfiguration,
IContainerRuntimeOptions,
type IContainerRuntimeOptionsInternal,
} from "@fluidframework/container-runtime/internal";
import {
IContainerRuntime,
Expand Down Expand Up @@ -54,7 +54,7 @@ interface backCompat_ContainerRuntime {
context: IContainerContext,
registryEntries: NamedFluidDataStoreRegistryEntries,
requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>,
runtimeOptions?: IContainerRuntimeOptions,
runtimeOptions?: IContainerRuntimeOptionsInternal,
containerScope?: FluidObject,
existing?: boolean,
containerRuntimeCtor?: typeof ContainerRuntime,
Expand All @@ -72,7 +72,7 @@ export const createTestContainerRuntimeFactory = (
constructor(
public type: string,
public dataStoreFactory: IFluidDataStoreFactory,
public runtimeOptions: IContainerRuntimeOptions = {
public runtimeOptions: IContainerRuntimeOptionsInternal = {
summaryOptions: {
summaryConfigOverrides: {
...DefaultSummaryConfiguration,
Expand Down
4 changes: 2 additions & 2 deletions packages/test/test-version-utils/src/compatUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { mixinAttributor } from "@fluid-experimental/attributor";
import { TestDriverTypes } from "@fluid-internal/test-driver-definitions";
import { FluidTestDriverConfig, createFluidTestDriver } from "@fluid-private/test-drivers";
import {
IContainerRuntimeOptions,
DefaultSummaryConfiguration,
CompressionAlgorithms,
ICompressionRuntimeOptions,
type IContainerRuntimeOptionsInternal,
} from "@fluidframework/container-runtime/internal";
import { FluidObject, IFluidLoadable, IRequest } from "@fluidframework/core-interfaces";
import { IFluidHandleContext } from "@fluidframework/core-interfaces/internal";
Expand Down Expand Up @@ -63,7 +63,7 @@ export const TestDataObjectType = "@fluid-example/test-dataStore";
*/
function filterRuntimeOptionsForVersion(
version: string,
optionsArg: IContainerRuntimeOptions = {
optionsArg: IContainerRuntimeOptionsInternal = {
summaryOptions: {
summaryConfigOverrides: {
...DefaultSummaryConfiguration,
Expand Down

0 comments on commit 489c5cc

Please sign in to comment.