-
Notifications
You must be signed in to change notification settings - Fork 541
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
Local server stress tests #23701
Local server stress tests #23701
Changes from all commits
dfce207
9f4da13
81d1c22
ebe34bd
905f13b
a3485fc
9caeda6
7a87d9d
f30352e
71ea73c
b0ece92
81d8e3a
203f02b
1b914de
c6be0f9
3835077
dd394f8
f369dfa
6610ad2
e2f82b1
162b6c8
0652c31
2d81fdf
ca6d121
741dbf8
547d066
1e2920d
3a926c8
14be150
8356bab
4d08036
ad03d25
857f458
3c77a32
442b236
8579ed0
f75a048
7bda962
a909d69
b75f336
f2bbc56
b74b48a
cfc8f93
2efdae9
d80f757
4d456d2
421eb69
1cc9574
833aad6
82613c2
d866256
80475fd
e08c871
f6838a0
b7f9bb8
317913b
7ca572c
853e616
2376ca4
3c94a51
bd3aebb
a82f245
010bcd0
8b2a984
1aef146
611121e
c582039
9a9e3e1
08d39d9
e4c1efd
08aa9f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/*! | ||
* Copyright (c) Microsoft Corporation and contributors. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
module.exports = { | ||
extends: [ | ||
require.resolve("@fluidframework/eslint-config-fluid/minimal-deprecated"), | ||
"prettier", | ||
], | ||
rules: { | ||
"import/no-nodejs-modules": "off", | ||
"@fluid-internal/fluid/no-unchecked-record-access": "warn", | ||
}, | ||
parserOptions: { | ||
project: ["./src/test/tsconfig.json"], | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Compiled TypeScript and CSS | ||
dist | ||
lib | ||
|
||
# Babel | ||
public/scripts/es5 | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
.cache-loader | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- | ||
node_modules | ||
|
||
# Typings | ||
typings | ||
|
||
# Debug log from npm | ||
npm-debug.log | ||
|
||
# Code coverage | ||
nyc | ||
.nyc_output/ | ||
|
||
# Chart dependencies | ||
**/charts/*.tgz | ||
|
||
# Generated modules | ||
intel_modules/ | ||
temp_modules/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/*! | ||
* Copyright (c) Microsoft Corporation and contributors. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common"); | ||
|
||
const packageDir = __dirname; | ||
const config = getFluidTestMochaConfig(packageDir); | ||
module.exports = config; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
nyc | ||
*.log | ||
**/*.tsbuildinfo | ||
src/test | ||
dist/test | ||
lib/test | ||
**/_api-extractor-temp/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Copyright (c) Microsoft Corporation and contributors. All rights reserved. | ||
|
||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json", | ||
"extends": ["../../../biome.jsonc"], | ||
"files": { | ||
"ignore": ["results/**"] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"name": "@fluid-internal/local-server-stress-tests", | ||
"version": "2.23.0", | ||
"private": true, | ||
"description": "Stress tests that can only run against the local server", | ||
"homepage": "https://fluidframework.com", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/microsoft/FluidFramework.git", | ||
"directory": "packages/test/local-server-stress-tests" | ||
}, | ||
"license": "MIT", | ||
"author": "Microsoft and contributors", | ||
"sideEffects": false, | ||
"type": "commonjs", | ||
"scripts": { | ||
"build": "fluid-build . --task build", | ||
"build:compile": "fluid-build . --task compile", | ||
"build:test": "tsc --project ./src/test/tsconfig.json", | ||
"check:biome": "biome check .", | ||
"check:format": "npm run check:biome", | ||
"check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore", | ||
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" nyc", | ||
"eslint": "eslint --format stylish src", | ||
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout", | ||
"format": "npm run format:biome", | ||
"format:biome": "biome check . --write", | ||
"format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore", | ||
"lint": "fluid-build . --task lint", | ||
"lint:fix": "fluid-build . --task eslint:fix --task format", | ||
"test": "npm run test:mocha", | ||
"test:coverage": "c8 npm test", | ||
"test:mocha": "mocha \"lib/test/**/*.spec.*js\" --exit", | ||
anthony-murphy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha" | ||
}, | ||
"c8": { | ||
"all": true, | ||
"cache-dir": "nyc/.cache", | ||
"exclude": [ | ||
"src/test/**/*.*ts", | ||
"dist/test/**/*.*js", | ||
"lib/test/**/*.*js" | ||
], | ||
"exclude-after-remap": false, | ||
"include": [ | ||
"src/**/*.*ts", | ||
"dist/**/*.*js", | ||
"lib/**/*.*js" | ||
], | ||
"report-dir": "nyc/report", | ||
"reporter": [ | ||
"cobertura", | ||
"html", | ||
"text" | ||
], | ||
"temp-directory": "nyc/.nyc_output" | ||
}, | ||
"dependencies": { | ||
"@fluid-experimental/tree": "workspace:~", | ||
"@fluid-internal/client-utils": "workspace:~", | ||
"@fluid-internal/mocha-test-setup": "workspace:~", | ||
"@fluid-private/stochastic-test-utils": "workspace:~", | ||
"@fluid-private/test-dds-utils": "workspace:~", | ||
"@fluidframework/aqueduct": "workspace:~", | ||
"@fluidframework/build-common": "^2.0.3", | ||
"@fluidframework/build-tools": "^0.53.0", | ||
"@fluidframework/container-definitions": "workspace:~", | ||
"@fluidframework/container-loader": "workspace:~", | ||
"@fluidframework/container-runtime": "workspace:~", | ||
"@fluidframework/container-runtime-definitions": "workspace:~", | ||
"@fluidframework/core-interfaces": "workspace:~", | ||
"@fluidframework/core-utils": "workspace:~", | ||
"@fluidframework/datastore": "workspace:~", | ||
"@fluidframework/datastore-definitions": "workspace:~", | ||
"@fluidframework/driver-definitions": "workspace:~", | ||
"@fluidframework/driver-utils": "workspace:~", | ||
"@fluidframework/eslint-config-fluid": "^5.7.3", | ||
"@fluidframework/id-compressor": "workspace:~", | ||
"@fluidframework/local-driver": "workspace:~", | ||
"@fluidframework/map": "workspace:~", | ||
"@fluidframework/runtime-definitions": "workspace:~", | ||
"@fluidframework/runtime-utils": "workspace:~", | ||
"@fluidframework/sequence": "workspace:~", | ||
"@fluidframework/server-local-server": "^5.0.0", | ||
"@fluidframework/telemetry-utils": "workspace:~", | ||
"@fluidframework/test-utils": "workspace:~", | ||
"@fluidframework/tree": "workspace:~", | ||
"uuid": "^9.0.0" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "~1.9.3", | ||
"@types/mocha": "^10.0.10", | ||
"@types/node": "^18.19.0", | ||
"@types/uuid": "^9.0.2", | ||
"c8": "^8.0.1", | ||
"cross-env": "^7.0.3", | ||
"eslint": "~8.55.0", | ||
"mocha": "^10.2.0", | ||
"mocha-multi-reporters": "^1.5.1", | ||
"prettier": "~3.0.3", | ||
"rimraf": "^4.4.0", | ||
"ts-loader": "^9.5.1", | ||
"typescript": "~5.4.5" | ||
}, | ||
"fluidBuild": { | ||
"tasks": { | ||
"build:test": [ | ||
"^tsc", | ||
"^api-extractor:commonjs", | ||
"@fluidframework/sequence#build:test", | ||
"@fluidframework/map#build:test" | ||
] | ||
} | ||
}, | ||
"typeValidation": { | ||
"disabled": true, | ||
"broken": {}, | ||
"entrypoint": "internal" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/*! | ||
* Copyright (c) Microsoft Corporation and contributors. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
module.exports = { | ||
...require("@fluidframework/build-common/prettier.config.cjs"), | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/*! | ||
* Copyright (c) Microsoft Corporation and contributors. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
import { done, type AsyncGenerator } from "@fluid-private/stochastic-test-utils"; | ||
import { DDSFuzzModel, DDSFuzzTestState } from "@fluid-private/test-dds-utils"; | ||
import type { IChannelFactory } from "@fluidframework/datastore-definitions/internal"; | ||
// eslint-disable-next-line import/no-internal-modules | ||
import { baseMapModel, baseDirModel } from "@fluidframework/map/internal/test"; | ||
import { | ||
baseSharedStringModel, | ||
baseIntervalModel, | ||
// eslint-disable-next-line import/no-internal-modules | ||
} from "@fluidframework/sequence/internal/test"; | ||
|
||
function repeatFactoryAsync<T, TState = void>( | ||
factory: () => AsyncGenerator<T, TState>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TIL we have our own non-standard version of AsyncGenerator that isn't even iterable :( Is there a world where we can get away from this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I've lamented this choice I made for a while now. We don't expose any of this publicly anywhere, so we can change it whenever we want with some refactoring. The one thing to emphasize is that the programming model for fuzz tests gets a little funky: when writing generators, one generally would need to capture the state of the underlying model somehow, and that state can change 'from beneath you' whenever you yield. This is pretty natural for async generators (the exact same concept is generally applicable to async code), but weirder for synchronous ones. As long as that's emphasized though in the appropriate places (not too many), a lot of things get more natural. I've been meaning to try hacking away at this in an FHL sometime. Maybe the upcoming one :) |
||
): AsyncGenerator<T, TState> { | ||
let generator = factory(); | ||
return async (state: TState) => { | ||
const next = await generator(state); | ||
if (next !== done) { | ||
return next; | ||
} | ||
generator = factory(); | ||
return generator(state); | ||
}; | ||
} | ||
|
||
const generateSubModelMap = ( | ||
...models: Omit<DDSFuzzModel<IChannelFactory, any>, "workloadName">[] | ||
) => { | ||
const modelMap = new Map< | ||
string, | ||
{ | ||
factory: IChannelFactory; | ||
generator: AsyncGenerator<any, DDSFuzzTestState<IChannelFactory>>; | ||
reducer: DDSFuzzModel<IChannelFactory, any>["reducer"]; | ||
validateConsistency: DDSFuzzModel<IChannelFactory, any>["validateConsistency"]; | ||
minimizationTransforms?: DDSFuzzModel<IChannelFactory, any>["minimizationTransforms"]; | ||
} | ||
>(); | ||
for (const model of models) { | ||
const { reducer, generatorFactory, factory, validateConsistency, minimizationTransforms } = | ||
model; | ||
const generator = repeatFactoryAsync(generatorFactory); | ||
modelMap.set(factory.attributes.type, { | ||
generator, | ||
reducer, | ||
factory, | ||
validateConsistency, | ||
minimizationTransforms, | ||
}); | ||
} | ||
|
||
return modelMap; | ||
}; | ||
|
||
/** | ||
* here we import the dds models, and do some minor changes to make this easier to nest in the local server stress model. | ||
*/ | ||
export const ddsModelMap = generateSubModelMap( | ||
anthony-murphy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
baseMapModel, | ||
baseDirModel, | ||
baseSharedStringModel, | ||
baseIntervalModel, | ||
); |
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.
package seems like a better fit for @fluid-private
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.
i thought about this, and will change it, but i also wasn't sure if we could run fluid private tests in our long running out stress runs
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.
I wouldn't expect issues with that