Skip to content

Conversation

@anthony-murphy-agent
Copy link
Contributor

Summary

Tunes stress test parameters for better coverage of detached operations:

  • Increase creationPhaseOps from 7 to 20
  • Increase numOpsBeforeAttach from 20 to 100
  • Increase total ops per test from 100 to 200
  • Disable createDataStore/createChannel during DDS ops phase (weight = 0)
  • Clear pendingLocalStateStore in test cleanup to prevent memory buildup

These changes ensure more thorough testing of detached state behavior before attach.

Dependencies

Test plan

  • local-server-stress-tests pass (200 seeds)
  • Verified increased operation count before attach

🤖 Generated with Claude Code

anthony-murphy-agent and others added 2 commits January 29, 2026 10:39
…ights

Enable generator weights to be functions that receive state and return a
weight, instead of only supporting static numeric weights. This allows
weights to vary based on the current test state.

Co-Authored-By: anthony-murphy <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Introduces operation phasing during the detached state before attach:
- Creation phase (first 7 ops): prioritizes createDataStore and createChannel
- DDS ops phase (ops 8-20): prioritizes DDSModelOp operations

This ensures tests create sufficient structure before exercising DDS operations.

Co-Authored-By: anthony-murphy <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
@anthony-murphy
Copy link
Contributor

/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid, Build - protocol-definitions, Build site

@anthony-murphy
Copy link
Contributor

/azp run Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enhances the local-server-stress-tests to provide better coverage of detached state operations by significantly increasing the number of operations performed before container attachment and introducing operation phasing during the detached state.

Changes:

  • Increased total operations per test from 100 to 200 for more comprehensive testing
  • Increased detached operations before attach from 20 to 100 to better test detached state behavior
  • Implemented operation phasing with dynamic weights: creation phase (first 20 ops) prioritizes datastore/channel creation, followed by DDS operations phase
  • Added dynamic weight generator infrastructure to support runtime-dependent operation weights
  • Added cleanup of pendingLocalStateStore to prevent memory buildup between tests

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
packages/test/local-server-stress-tests/src/test/localServerStress.spec.ts Doubled total operations from 100 to 200 for more thorough testing
packages/test/local-server-stress-tests/src/localServerStressHarness.ts Increased numOpsBeforeAttach from 20 to 100, changed import from type-only to value import for DefaultStressDataObject, added pendingLocalStateStore cleanup
packages/test/local-server-stress-tests/src/dynamicWeightGenerator.ts New file implementing weighted generator with dynamic weight functions that can vary based on runtime state
packages/test/local-server-stress-tests/src/baseModel.ts Implemented two-phase operation generation (creation phase and DDS ops phase) with dynamic weights, updated imports to use new dynamic weight generator

anthony-murphy-agent and others added 2 commits January 29, 2026 10:53
Move the counter increment to after asyncGenerator() returns so that
the first 20 ops are truly in creation phase. Previously, incrementing
before meant only 19 ops were in creation phase.

Co-Authored-By: anthony-murphy <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Increase creationPhaseOps from 7 to 20
- Increase numOpsBeforeAttach from 20 to 100
- Increase total ops per test from 100 to 200
- Disable createDataStore/createChannel during DDS ops phase
- Clear pendingLocalStateStore in test cleanup

Co-Authored-By: anthony-murphy <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
@anthony-murphy-agent anthony-murphy-agent force-pushed the fix/stress-test-param-tuning branch from 4c389e8 to fe3a71e Compare January 29, 2026 18:54
anthony-murphy-agent and others added 3 commits January 29, 2026 10:57
- Fix JSDoc escape sequence: `=\>` to `=>` in dynamicWeightGenerator.ts
- Add bounds checking to sampling loop in dynamicWeightGenerator.ts
- Update comments for createDataStore and createChannel to accurately describe
  behavior across all phases (creation, DDS ops, attached)

Co-Authored-By: anthony-murphy <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
… in-memory maps

Remove channelNameMap and containerObjectMap SharedMaps from StressDataObject
and replace them with in-memory tracking managed by the test harness. This
eliminates issues with rollback/staging mode interference and simplifies the
tracking architecture.

Changes:
- Remove channelNameMap and containerObjectMap DDSes from StressDataObject
- Add channelsByDatastore and containerObjectsByUrl maps to LocalServerStressState
- Update getChannels() and getContainerObjects() to take parameters from harness
- Add datastoreTag to state for operation context
- Update createDataStore to return absoluteUrl for tracking
- Update validation functions to accept state with tracking maps

Co-Authored-By: anthony-murphy <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Changes the channel selection algorithm to pick a channel type first
(uniformly across all available types), then pick a channel of that
type from a global pool across all datastores. This reduces bias toward
the directory type, which was over-represented because every datastore
has a root directory.

Before: 75% of DDSModelOps were directory operations
After: 41.7% are directory operations

The remaining bias occurs after container attach when remote clients
can only access datastore-0's channels reliably. Before attach (single
client phase), the distribution is nearly uniform (~25% per type).

Co-Authored-By: anthony-murphy <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
@anthony-murphy
Copy link
Contributor

/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid, Build - protocol-definitions, Build site

@anthony-murphy
Copy link
Contributor

/azp run Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

- Add ignore pattern for src/test/results/ directory in biome.jsonc
- Fix TSDoc escape sequences (=> and {})
- Fix no-shadow lint errors by renaming local variables
- Replace non-null assertions with proper assertions
- Add type guard to filter for proper type narrowing
- Add ContainerStateTracker for consolidated state management

Co-Authored-By: anthony-murphy <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
@anthony-murphy-agent
Copy link
Contributor Author

Azure Pipelines commands (copy and post separately, limit of 10 at a time):

/azp run Build - api-markdown-documenter, Build - benchmark-tool, Build - build-common, Build - build-tools, Build - client packages, Build - common-utils, Build - eslint-config-fluid, Build - eslint-plugin-fluid, Build - protocol-definitions, Build - test-tools
/azp run repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants