Skip to content

Latest commit

 

History

History
 
 

test-service-load

@fluid-internal/test-service-load

Note: This tool has dependencies on Microsoft-internal systems.

NodeJs-based test to simulate many clients and a high rate of op generation.

Pre-requisites

  • Run getkeys at some point to enable your machine to retrieve required OAuth tokens and passwords. You do not need to run it more than once, it will persist the keys for future sessions.
  • If you are using a username not already present in testConfig.json, then you'll need to add the password to the login__odsp__test__accounts environment variable. The format is simple:
{"[email protected]": "pwd_foo", "[email protected]": "pwd_bar", ...}

If you intend to check in the new username, please reach out to someone on the team who can add the creds to Azure Key Vault.

Usage

This package runs in two different modes: Orchestrator Mode and Test Runner mode

Orchestrator Mode

This is the main entry point to the test - this Orchestrator process will spawn many Test Runner processes.

node ./dist/nodeStressTest.js [--url <url>] [--tenant <tenant>] [--profile <profile>] [--debug] [--log <filterTerm>]

Test Runner Mode

This is not typically invoked manually - rather, the Orchestrator process spawns Test Runners using this mode. See the call to child_process.spawn in the source code to refer to arguments used to launch in this mode

npm scripts

There are several npm scripts in package.json to make it quicker to launch this tool. Among others: npm run start - Launches in Orchestrator Mode with default options npm run debug - Debugs in Orchestrator Mode with --debug provided to allow for attaching to child test runners.

URL

When running the stress tests, there will be a URL printed in console, after the line "Connecting to new Container targeting with url:". This URL can be passed as-is to Fluid Debugger as well as fetch-tool.

Options

--driver, -d

Specifies which test driver to use: odsp, routerlicious, tinylicious. The config for the drivers is pulled from the environment. See Test Driver.

--driverEndpoint, -e

Specifies which endpoint of test driver to use: odsp, odsp-df for odsp driver or frs, r11s, docker for routerlicious driver.

--profile, -p

Specifies which test profile to use from testConfig.json. Defaults to ci.

--testId, -id

If present, the test will load an existing data store for the given test id rather than creating a new container and data store. (Required when --runId is provided)

--runId, -r

If present, launch in Test Runner mode with the given runId (to distinguish from other concurrent test runners). --url is required, since the test runner needs to know which data store to connect to.

--debug, -dbg

Launches each test runner with --inspect-brk and a unique Node debugging port. (Not compatible with --runId)

--createTestId

If the testId argument is specified, the createTestId flag determines whether to load an exisiting document corresponding to the testId specified, or create a new one. When createTestId is set to true, a new document is created, and when createTestId is false, we try to load an existing document.

--log, -l

Overrides DEBUG environment variable for telemetry logging to console. If DEBUG env variable is unset and this is not provided, only errors will print. The value passed here should be a filter string for the logger namespace.

To print all messages, provide --log '*' or --log 'fluid:*'. For example, to filter to only Container logs, provide something like: -l 'fluid:telemetry:Container:*'.

Trademark

This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services. Use of these trademarks or logos must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.