-
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] Update perf tests to use a single sender for all instances #14460
Changes from all commits
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 |
---|---|---|
|
@@ -9,24 +9,22 @@ import * as dotenv from "dotenv"; | |
dotenv.config(); | ||
|
||
const connectionString = getEnvVar("SERVICEBUS_CONNECTION_STRING"); | ||
const sbClient = new ServiceBusClient(connectionString); | ||
|
||
export abstract class ServiceBusTest<TOptions> extends PerfStressTest<TOptions> { | ||
sbClient: ServiceBusClient; | ||
static sbClient: ServiceBusClient = new ServiceBusClient(connectionString); | ||
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. Any reason not to do this in globalSetup()? 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. Doesn't matter. It would work the same way. In my mind.. I've kept globalSteup for creating the resources and the initialization of clients at the static variable declaration itself. |
||
static sbAdminClient = new ServiceBusAdministrationClient(connectionString); | ||
static queueName = `newqueue-${Math.ceil(Math.random() * 1000)}`; | ||
|
||
constructor() { | ||
super(); | ||
this.sbClient = sbClient; | ||
} | ||
|
||
public async globalSetup(): Promise<void> { | ||
await ServiceBusTest.sbAdminClient.createQueue(ServiceBusTest.queueName); | ||
} | ||
|
||
public async globalCleanup(): Promise<void> { | ||
await ServiceBusTest.sbClient.close(); | ||
await ServiceBusTest.sbAdminClient.deleteQueue(ServiceBusTest.queueName); | ||
await this.sbClient.close(); | ||
} | ||
} |
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.
Wow, did not know you could do this!
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.
Learned it yesterday! :)
All hail npm! All hail SOF!!!