-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Service Bus] StressTests scenarios #11546
[Service Bus] StressTests scenarios #11546
Conversation
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.
Looking like a great start to me.
I'm wondering if you can lean on any of the work we've got for our normal live tests (like creating/recreating entities, etc..)
sdk/servicebus/service-bus/test/stress-test-track-2/stressTestsBase.ts
Outdated
Show resolved
Hide resolved
Also want to mention that you've got a lot of TODOs about making the limits configurable, which is great. I would suggest we get that in place sooner rather than later or else we'll end up baking them in unintentionally and with these kinds of tests you want to be clear about what your measurements/intervals/timings are. |
Good idea.. I'll re-use wherever I can. |
sdk/servicebus/service-bus/test/stress-test-track-2/SetupAndGuide.md
Outdated
Show resolved
Hide resolved
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@azure/service-bus": "^7.0.0-preview.6", |
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.
"@azure/service-bus": "^7.0.0-preview.6", | |
"@azure/service-bus": "^7.0.0-preview.7", |
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.
Currently, the code is written based on preview.6, I'll update both the code and the version to incorporate the changes that we recently did to sessions.
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.
Forgot to update that I've updated this! :P
let receiver: ServiceBusReceiver<ServiceBusReceivedMessage>; | ||
|
||
if (receiveMode === "receiveAndDelete") { | ||
receiver = sbClient.createReceiver(stressBase.queueName, { | ||
receiveMode: "receiveAndDelete" | ||
}); | ||
} else { | ||
receiver = sbClient.createReceiver(stressBase.queueName); | ||
} |
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.
Why not use the receiveMode directly?
let receiver: ServiceBusReceiver<ServiceBusReceivedMessage>; | |
if (receiveMode === "receiveAndDelete") { | |
receiver = sbClient.createReceiver(stressBase.queueName, { | |
receiveMode: "receiveAndDelete" | |
}); | |
} else { | |
receiver = sbClient.createReceiver(stressBase.queueName); | |
} | |
const receiver = sbClient.createReceiver(stressBase.queueName, { | |
receiveMode: "receiveAndDelete" | |
}); |
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.
That's a typescript limitation with the string literal union types - example to try out.
In a gist, it tries to match the union type with the string literal type from each of the overloads in the function definition, and none of them match individually.
sdk/servicebus/service-bus/test/stress-test-track-2/scenarioPeekMessages.ts
Show resolved
Hide resolved
); | ||
elapsedTime = new Date().valueOf() - startedAt.valueOf(); | ||
messages.map((msg) => | ||
stressBase.renewMessageLockUntil( |
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.
It is not clear to me what our expectation here is...
The renewMessageLockUntil
will keep renewing the lock... what are we looking for? That no error occurs?
Where will the error surface?
And when does the program end? We are awaiting on receiveMessages() but not really for the renewMessageLockUntil to finish?
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.
The time duration for renewMessageLockUntil
is less than the testDuration always, and hence would end before, and lock renewals are being done through setTimeouts.
The intention behind the test is to have many messages for which we'd be renewing the locks, note down the errors if any, observe the limits.. as in number of messages can we handle, etc.
while (elapsedTime < testDurationInMs) { | ||
let receiver; | ||
try { | ||
receiver = await sbClient.createSessionReceiver(stressBase.queueName, { |
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.
Why create a new receiver in each iteration of the loop?
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.
The intention behind this test to keep renewing the locks for multiple sessions and observe any unexpected behaviour with maintaining a huge number of sessions at the same time.
…ide.md Co-authored-by: Ramya Rao <[email protected]>
…om/HarshaNalluru/azure-sdk-for-js into harshan/sb/service-bus-stress-base
…to harshan/sb/service-bus-stress-base
### Original issue - #11108 Follow-up of the stress tests PR #11546, here are the changes - Uses the latest preview.8 version of the service-bus SDK - Fixes the boolean options being passed as command-line args - Multiple sessions support in the renew session lock test - Adds (some)new options that can be passed as command-line args to the tests - And maybe minor edits
"stress-tests-track-2" folder is an independent npm project with a package.json. Currently, testing preview.6 version of the SDK.
The following is a brief introduction to the contents.
stressTestsBase
scenario{...}.ts
StressTestsBase
, and uses the methods provided by the class and tailors the scenariots-node
ts-node scenario{...}.ts --delayBetweenSendsInMs=100
setupAndGuide.md