Skip to content

Commit 0b9d82b

Browse files
authored
[core-rest-pipeline] WWW-Authenticate challenge perf-stress test (Azure#14659)
This PR is a draft of how the WWW-Authenticate perf-stress would look. **What this first performance test does:** This initial test only sets up a pipeline that does a service request against a fake server that answers once with a WWW-Authenticate challenge, and the next time with a 200. So, the first request will fail, we'll get a challenge, the challenge will be parsed and another request will be sent afterwards, which will succeed. To run the test, we call to: `npm run perf-test:node -- BearerTokenChallengeAuthenticationPolicyTest --warmup 1 --iterations 1 --parallel 5`. Here's how it looks when it runs: ``` === Calling globalSetup() once for (all) the instance(s) of BearerTokenChallengeAuthenticationPolicyTest === === warmup mode, iteration 1. Logs every 1s === Current Total Average === warmup mode, results of iteration 1 === Completed 55,001 operations in a weighted-average of 1.00s (55,015.93 ops/s, 0.000 s/op) === test mode, iteration 1. Logs every 1s === Current Total Average === test mode, results of iteration 1 === Completed 537,426 operations in a weighted-average of 10.00s (53,741.61 ops/s, 0.000 s/op) ``` **Background:** Java's perf-stress for challenges uses the ARM kind of challenges, but on TypeScript our more immediate customer is not ARM, but Container Registry and then Key Vault. This PR uses a copy of the challenge test we have in the main challenge PR: Azure#13888 (this PR hasn't been merged, the plan is to have it merged by next week). Keep in mind that this PR won't pass CI until Azure#13888 is merged. The idea with this PR is that, besides perf-stress testing a basic scenario, we can use it as the base for further perf-stress tests for core-rest-pipeline. Fixes Azure#14633
1 parent 5d9c0fb commit 0b9d82b

File tree

9 files changed

+332
-24
lines changed

9 files changed

+332
-24
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 43 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rush.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,11 @@
726726
"packageName": "@azure-tests/perf-ai-metrics-advisor",
727727
"projectFolder": "sdk/metricsadvisor/perf-tests/ai-metrics-advisor",
728728
"versionPolicyName": "test"
729+
},
730+
{
731+
"packageName": "@azure-tests/perf-core-rest-pipeline",
732+
"projectFolder": "sdk/core/perf-tests/core-rest-pipeline",
733+
"versionPolicyName": "test"
729734
}
730735
]
731736
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (Unreleased)
4+
5+
- Added a first performance test that processes WWW-Authenticate challenges.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### Guide
2+
3+
1. Build the core-rest-pipeline perf tests package `rush build -t perf-core-rest-pipeline`.
4+
3. Copy the `sample.env` file and name it as `.env`.
5+
4. Populate the `.env` file with your Azure Credentials.
6+
5. Refer to the [rate limits](https://docs.microsoft.com/azure/active-directory/enterprise-users/directory-service-limits-restrictions) and then run the tests as follows:
7+
8+
- `bearerTokenChallengeAuthenticationPolicy` test for the `challengeCallbacks`, for simple `WWW-Authenticate` challenges.
9+
- `npm run perf-test:node -- BearerTokenChallengeAuthenticationPolicyTest --warmup 1 --iterations 1 --parallel 5`
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "@azure-tests/perf-core-rest-pipeline",
3+
"version": "1.0.0-beta.1",
4+
"description": "",
5+
"main": "",
6+
"keywords": [],
7+
"author": "",
8+
"license": "ISC",
9+
"dependencies": {
10+
"@azure/core-rest-pipeline": "1.1.0-beta.1",
11+
"@azure/core-auth": "^1.3.0",
12+
"@azure/test-utils-perfstress": "^1.0.0",
13+
"dotenv": "^8.2.0"
14+
},
15+
"devDependencies": {
16+
"@types/uuid": "^8.0.0",
17+
"eslint": "^7.15.0",
18+
"prettier": "^1.16.4",
19+
"rimraf": "^3.0.0",
20+
"ts-node": "^9.0.0",
21+
"tslib": "^2.0.0",
22+
"typescript": "~4.2.0"
23+
},
24+
"private": true,
25+
"scripts": {
26+
"perf-test:node": "ts-node test/index.spec.ts",
27+
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
28+
"build": "tsc -p .",
29+
"build:samples": "echo skipped",
30+
"build:test": "echo skipped",
31+
"check-format": "prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
32+
"clean": "rimraf dist dist-esm test-dist typings *.tgz *.log",
33+
"format": "prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
34+
"integration-test:browser": "echo skipped",
35+
"integration-test:node": "echo skipped",
36+
"integration-test": "echo skipped",
37+
"lint:fix": "eslint --no-eslintrc -c ../../../.eslintrc.internal.json package.json test --ext .ts --fix --fix-type [problem,suggestion]",
38+
"lint": "eslint --no-eslintrc -c ../../../.eslintrc.internal.json package.json test --ext .ts",
39+
"pack": "npm pack 2>&1",
40+
"prebuild": "npm run clean",
41+
"unit-test:browser": "echo skipped",
42+
"unit-test:node": "echo skipped",
43+
"unit-test": "echo skipped",
44+
"test:browser": "echo skipped",
45+
"test:node": "echo skipped",
46+
"test": "echo skipped"
47+
}
48+
}

sdk/core/perf-tests/core-rest-pipeline/sample.env

Whitespace-only changes.

0 commit comments

Comments
 (0)