-
Notifications
You must be signed in to change notification settings - Fork 562
feat(local-server-stress-tests): increase ops before attach to 100 #26326
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
base: main
Are you sure you want to change the base?
feat(local-server-stress-tests): increase ops before attach to 100 #26326
Conversation
…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]>
|
/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 |
|
/azp run Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this 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
pendingLocalStateStoreto 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 |
packages/test/local-server-stress-tests/src/dynamicWeightGenerator.ts
Outdated
Show resolved
Hide resolved
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]>
4c389e8 to
fe3a71e
Compare
- 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]>
|
/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 |
|
/azp run Build - test-tools, repo-policy-check, server-gitrest, server-gitssh, server-historian, server-routerlicious |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
|
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]>
|
Azure Pipelines commands (copy and post separately, limit of 10 at a time): |
Summary
Tunes stress test parameters for better coverage of detached operations:
creationPhaseOpsfrom 7 to 20numOpsBeforeAttachfrom 20 to 100createDataStore/createChannelduring DDS ops phase (weight = 0)pendingLocalStateStorein test cleanup to prevent memory buildupThese changes ensure more thorough testing of detached state behavior before attach.
Dependencies
Test plan
🤖 Generated with Claude Code