Skip to content

Commit 61e8af4

Browse files
[azservicebus,azeventhubs] some more stress test fixes (Azure#22963)
* Service bus stress test fixes - we were still loading the old connection string variables. * Fixing Event Hubs stress template.
1 parent 9cc7c45 commit 61e8af4

File tree

5 files changed

+38
-30
lines changed

5 files changed

+38
-30
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: stress-test-addons
33
repository: https://stresstestcharts.blob.core.windows.net/helm/
4-
version: 0.3.1
5-
digest: sha256:28e374f8db5c46447b2a1491d4361ceb126536c425cbe54be49017120fe7b27d
6-
generated: "2024-03-01T17:51:06.962215142-08:00"
4+
version: 0.3.2
5+
digest: sha256:6eee71a7e8a4c0dc06d5fbbce39ef63237a0db0b7fc2da66e98e96b68985b764
6+
generated: "2024-05-30T01:22:48.620817144Z"

sdk/messaging/azeventhubs/internal/eh/stress/stress-test-resources.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,20 @@
142142
]
143143
}
144144
]
145-
},
145+
}
146146
],
147147
"outputs": {
148148
"EVENTHUB_NAME_STRESS": {
149149
"type": "string",
150150
"value": "[variables('eventHubName')]"
151151
},
152-
"EVENTHUB_CONNECTION_STRING": {
152+
"EVENTHUB_NAMESPACE": {
153153
"type": "string",
154-
"value": "[listKeys(resourceId('Microsoft.EventHub/namespaces/authorizationRules', variables('namespaceName'), 'RootManageSharedAccessKey'), variables('apiVersion')).primaryConnectionString]"
154+
"value": "[concat(variables('namespaceName'), '.servicebus.windows.net')]"
155155
},
156-
"CHECKPOINTSTORE_STORAGE_CONNECTION_STRING": {
156+
"CHECKPOINTSTORE_STORAGE_ENDPOINT": {
157157
"type": "string",
158-
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), variables('storageApiVersion')).keys[0].value, ';EndpointSuffix=', parameters('storageEndpointSuffix'))]"
158+
"value": "[reference(variables('storageAccountName')).primaryEndpoints.blob]"
159159
}
160160
}
161161
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: stress-test-addons
33
repository: https://stresstestcharts.blob.core.windows.net/helm/
4-
version: 0.3.1
5-
digest: sha256:28e374f8db5c46447b2a1491d4361ceb126536c425cbe54be49017120fe7b27d
6-
generated: "2024-02-05T17:21:31.510400504-08:00"
4+
version: 0.3.2
5+
digest: sha256:6eee71a7e8a4c0dc06d5fbbce39ef63237a0db0b7fc2da66e98e96b68985b764
6+
generated: "2024-05-30T01:39:24.209525275Z"

sdk/messaging/azservicebus/internal/stress/shared/stress_context.go

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313

1414
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
1515
azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log"
16+
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
1617
"github.com/Azure/azure-sdk-for-go/sdk/messaging/azservicebus"
1718
"github.com/microsoft/ApplicationInsights-Go/appinsights"
1819
)
@@ -94,10 +95,10 @@ type StressContextOptions struct {
9495
}
9596

9697
func MustCreateStressContext(testName string, options *StressContextOptions) *StressContext {
97-
cs := os.Getenv("SERVICEBUS_CONNECTION_STRING")
98+
sbEndpoint := os.Getenv("SERVICEBUS_ENDPOINT")
9899

99-
if cs == "" {
100-
log.Fatalf("missing SERVICEBUS_CONNECTION_STRING environment variable")
100+
if sbEndpoint == "" {
101+
log.Fatalf("missing SERVICEBUS_ENDPOINT environment variable")
101102
}
102103

103104
aiKey := os.Getenv("APPINSIGHTS_INSTRUMENTATIONKEY")
@@ -106,6 +107,12 @@ func MustCreateStressContext(testName string, options *StressContextOptions) *St
106107
log.Fatalf("missing APPINSIGHTS_INSTRUMENTATIONKEY environment variable")
107108
}
108109

110+
cred, err := azidentity.NewDefaultAzureCredential(nil)
111+
112+
if err != nil {
113+
log.Fatalf("failed to create DefaultAzureCredential: %s", err)
114+
}
115+
109116
config := appinsights.NewTelemetryConfiguration(aiKey)
110117
config.MaxBatchInterval = 5 * time.Second
111118
telemetryClient := appinsights.NewTelemetryClientFromConfig(config)
@@ -161,15 +168,14 @@ func MustCreateStressContext(testName string, options *StressContextOptions) *St
161168
// })
162169

163170
sc := &StressContext{
164-
TestRunID: testRunID,
165-
Nano: testRunID, // the same for now
166-
TC: telemetryClient,
167-
// you could always change the interval here. A minute feels like often enough
168-
// to know things are running, while not so often that you end up flooding logging
169-
// with duplicate information.
170-
logMessages: logMessages,
171-
Context: ctx,
172171
cancel: cancel,
172+
Context: ctx,
173+
Cred: cred,
174+
Endpoint: sbEndpoint,
175+
logMessages: logMessages,
176+
Nano: testRunID, // the same for now
177+
TC: telemetryClient,
178+
TestRunID: testRunID,
173179
}
174180

175181
if options != nil && options.EmitStartEvent {

sdk/messaging/azservicebus/internal/stress/stress-test-resources.bicep

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ var apiVersion = '2017-04-01'
1111
// Uncomment this if you want to test against the southeastasia nodes.
1212
//var location = 'southeastasia'
1313
var location = resourceGroup().location
14-
var authorizationRuleName_var = '${baseName}/RootManageSharedAccessKey'
15-
var authorizationRuleNameNoManage_var = '${baseName}/NoManage'
1614
var serviceBusDataOwnerRoleId = '/subscriptions/${subscription().subscriptionId}/providers/Microsoft.Authorization/roleDefinitions/090c5cfd-751d-490a-894a-3ce6f1109419'
1715

1816
resource servicebus 'Microsoft.ServiceBus/namespaces@2018-01-01-preview' = {
@@ -28,7 +26,7 @@ resource servicebus 'Microsoft.ServiceBus/namespaces@2018-01-01-preview' = {
2826
}
2927

3028
resource authorizationRuleName 'Microsoft.ServiceBus/namespaces/AuthorizationRules@2015-08-01' = {
31-
name: authorizationRuleName_var
29+
name: '${baseName}/RootManageSharedAccessKey'
3230
location: location
3331
properties: {
3432
rights: [
@@ -43,7 +41,7 @@ resource authorizationRuleName 'Microsoft.ServiceBus/namespaces/AuthorizationRul
4341
}
4442

4543
resource authorizationRuleNameNoManage 'Microsoft.ServiceBus/namespaces/AuthorizationRules@2015-08-01' = {
46-
name: authorizationRuleNameNoManage_var
44+
name: '${baseName}/NoManage'
4745
location: location
4846
properties: {
4947
rights: [
@@ -56,8 +54,6 @@ resource authorizationRuleNameNoManage 'Microsoft.ServiceBus/namespaces/Authoriz
5654
]
5755
}
5856

59-
60-
6157
resource dataOwnerRoleId 'Microsoft.Authorization/roleAssignments@2018-01-01-preview' = {
6258
name: guid('dataOwnerRoleId${baseName}')
6359
properties: {
@@ -105,8 +101,14 @@ resource testQueueWithSessions 'Microsoft.ServiceBus/namespaces/queues@2017-04-0
105101
}
106102
}
107103

108-
output SERVICEBUS_CONNECTION_STRING string = listKeys(resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', baseName, 'RootManageSharedAccessKey'), apiVersion).primaryConnectionString
109-
output SERVICEBUS_CONNECTION_STRING_NO_MANAGE string = listKeys(resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', baseName, 'NoManage'), apiVersion).primaryConnectionString
104+
output SERVICEBUS_CONNECTION_STRING string = listKeys(
105+
resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', baseName, 'RootManageSharedAccessKey'),
106+
apiVersion
107+
).primaryConnectionString
108+
output SERVICEBUS_CONNECTION_STRING_NO_MANAGE string = listKeys(
109+
resourceId('Microsoft.ServiceBus/namespaces/authorizationRules', baseName, 'NoManage'),
110+
apiVersion
111+
).primaryConnectionString
110112
output SERVICEBUS_ENDPOINT string = replace(servicebus.properties.serviceBusEndpoint, ':443/', '')
111113
output QUEUE_NAME string = 'testQueue'
112114
output QUEUE_NAME_WITH_SESSIONS string = 'testQueueWithSessions'

0 commit comments

Comments
 (0)