From 2e806adf2986e6a1ee303ac1a2a97d139689aa29 Mon Sep 17 00:00:00 2001 From: Timo van Veenendaal Date: Wed, 20 Oct 2021 10:40:21 -0700 Subject: [PATCH] [Perf Framework] rename runAsync method to run (#18033) --- .../test/listSettings.spec.ts | 2 +- .../test/listArtifacts.spec.ts | 2 +- .../test/listRepositories.spec.ts | 2 +- .../wwwChallenge.spec.ts | 2 +- .../eventgrid/test/sendCloudEvents.spec.ts | 2 +- .../event-hubs-track-1/test/send.spec.ts | 2 +- .../perf-tests/event-hubs/test/send.spec.ts | 2 +- .../ai-form-recognizer/test/custom.spec.ts | 2 +- .../persistence.spec.ts | 2 +- .../test/getCertificate.spec.ts | 2 +- .../test/cryptography/decrypt.spec.ts | 2 +- .../test/cryptography/sign.spec.ts | 2 +- .../test/cryptography/unwrapKey.spec.ts | 2 +- .../keyvault-keys/test/keys/get.spec.ts | 2 +- .../keyvault-secrets/test/getSecret.spec.ts | 2 +- .../keyvault-secrets/test/listSecrets.spec.ts | 2 +- .../test/listAnomalies.spec.ts | 2 +- .../test/listIncidents.spec.ts | 2 +- .../test/rootCauses.spec.ts | 2 +- .../monitor-query/test/logQuery.spec.ts | 2 +- .../monitor-query/test/logQueryBatch.spec.ts | 2 +- .../monitor-query/test/metricQuery.spec.ts | 2 +- .../test/autoCompleteTest.spec.ts | 2 +- .../test/indexDocumentsTest.spec.ts | 2 +- .../test/searchDocumentsTest.spec.ts | 2 +- .../search-documents/test/suggestTest.spec.ts | 2 +- .../test/sendBatch.spec.ts | 2 +- .../service-bus/test/sendBatch.spec.ts | 2 +- .../test/download.spec.ts | 2 +- .../test/listBlobs.spec.ts | 2 +- .../storage-blob-track-1/test/upload.spec.ts | 2 +- .../storage-blob/test/core-http.spec.ts | 2 +- .../test/core-rest-pipeline.spec.ts | 2 +- .../storage-blob/test/dowloadWithSAS.spec.ts | 2 +- .../storage-blob/test/download.spec.ts | 2 +- .../storage-blob/test/listBlobs.spec.ts | 2 +- .../storage-blob/test/node-fetch.spec.ts | 2 +- .../storage-blob/test/upload.spec.ts | 2 +- .../storage-blob/test/uploadFromFile.spec.ts | 2 +- .../storage-file-datalake/test/append.spec.ts | 2 +- .../storage-file-datalake/test/read.spec.ts | 2 +- .../storage-file-datalake/test/upload.spec.ts | 2 +- .../test/uploadFromFile.spec.ts | 2 +- .../test/download.spec.ts | 2 +- .../test/upload.spec.ts | 2 +- .../storage-file-share/test/download.spec.ts | 2 +- .../test/downloadToFile.spec.ts | 2 +- .../storage-file-share/test/upload.spec.ts | 2 +- .../test/uploadFromFile.spec.ts | 2 +- .../test/createComplexEntity.spec.ts | 2 +- .../test/createComplexEntityBatchTest.spec.ts | 2 +- .../test/createSimpleEntity.spec.ts | 2 +- .../test/createSimpleEntityBatchTest.spec.ts | 2 +- .../test/listComplexEntities.spec.ts | 2 +- .../test/listSimpleEntities.spec.ts | 2 +- sdk/test-utils/perf/GettingStarted.md | 6 ++--- sdk/test-utils/perf/README.md | 12 +++++----- sdk/test-utils/perf/src/program.ts | 24 +++++++++---------- .../perf/src/testProxyHttpClient.ts | 2 +- sdk/test-utils/perf/src/tests.ts | 2 +- sdk/test-utils/perf/test/delay.spec.ts | 2 +- sdk/test-utils/perf/test/exception.spec.ts | 2 +- sdk/test-utils/perf/test/nodeFetch.spec.ts | 2 +- sdk/test-utils/perf/test/noop.spec.ts | 2 +- sdk/test-utils/perf/test/options.spec.ts | 2 +- sdk/test-utils/perf/test/perfPolicy.spec.ts | 2 +- .../perf/test/serviceClientGet.spec.ts | 2 +- sdk/test-utils/perf/test/setupCleanup.spec.ts | 2 +- sdk/test-utils/perf/test/sleep.spec.ts | 2 +- .../test/detectLanguage.spec.ts | 2 +- 70 files changed, 88 insertions(+), 88 deletions(-) diff --git a/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts b/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts index 520039664243..c9daf65ff4dd 100644 --- a/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts +++ b/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts @@ -39,7 +39,7 @@ export class ListSettingsTest extends AppConfigTest { ); } - async runAsync(): Promise { + async run(): Promise { for await (const response of this.client .listConfigurationSettings({ keyFilter: ListSettingsTest.prefix + "*" }) .byPage()) { diff --git a/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts b/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts index f7af781734eb..61cd8fa4275e 100644 --- a/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts +++ b/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts @@ -12,7 +12,7 @@ export class ArtifactListTest extends ContainerRegistryTest { + async run(): Promise { const listIterator = this.repository.listManifestProperties(); for await (const manifest of listIterator) { diff --git a/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts b/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts index 727168526767..c73125d537e3 100644 --- a/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts +++ b/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts @@ -9,7 +9,7 @@ export class RepositoryListTest extends ContainerRegistryTest { + async run(): Promise { const listIterator = this.client.listRepositoryNames(); // eslint-disable-next-line no-empty diff --git a/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts b/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts index 1139109baf0c..7e9708b6cb1f 100644 --- a/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts +++ b/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts @@ -193,7 +193,7 @@ export class BearerTokenAuthenticationPolicyChallengeTest extends PerfTest { }; } - async runAsync(): Promise { + async run(): Promise { const { pipeline, testHttpsClient, request } = BearerTokenAuthenticationPolicyChallengeTest; await pipeline!.sendRequest(testHttpsClient!, request!); } diff --git a/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts b/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts index b8a2b4208c28..707fb06c1c5c 100644 --- a/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts +++ b/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts @@ -47,7 +47,7 @@ export class SendCloudEventsTest extends PerfTest { + async run(): Promise { await this.client.send(this.events); } } diff --git a/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts b/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts index b37440f4af4c..76e630eb92a9 100644 --- a/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts +++ b/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts @@ -53,7 +53,7 @@ export class SendTest extends PerfTest { await this.producer.close(); } - async runAsync(): Promise { + async run(): Promise { await this.producer.sendBatch(this.eventBatch); } } diff --git a/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts b/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts index 64a4b7b1f99e..e9147d1d8bfa 100644 --- a/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts +++ b/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts @@ -54,7 +54,7 @@ export class SendTest extends PerfTest { await this.producer.close(); } - async runAsync(): Promise { + async run(): Promise { await this.producer.sendBatch(this.eventBatch); } } diff --git a/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts b/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts index 8d3cb6556ece..b0e50ba72e44 100644 --- a/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts +++ b/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts @@ -83,7 +83,7 @@ export class CustomModelRecognitionTest extends PerfTest { + async run(): Promise { const modelId = CustomModelRecognitionTest.sessionModel?.modelId; if (!modelId) { return unreachable("Failed to initialize model."); diff --git a/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts b/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts index c35b73c07acc..14e135c25473 100644 --- a/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts +++ b/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts @@ -34,7 +34,7 @@ export class ClientSecretCredentialPersistenceTest extends PerfTest { ClientSecretCredentialPersistenceTest.credential = credential; } - async runAsync(): Promise { + async run(): Promise { await ClientSecretCredentialPersistenceTest.credential.getToken(scope); } } diff --git a/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts b/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts index 383421e0fdfe..fbe7a097d38b 100644 --- a/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts @@ -35,7 +35,7 @@ export abstract class CertificateTest extends PerfTest { export class GetCertificateTest extends CertificateTest { public options = {}; - async runAsync(): Promise { + async run(): Promise { await this.certificateClient.getCertificate(CertificateTest.certificateName); } } diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/decrypt.spec.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/decrypt.spec.ts index 64e53f501282..2554e1a82d06 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/decrypt.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/decrypt.spec.ts @@ -14,7 +14,7 @@ export class DecryptTest extends CryptographyTest { this.cipherText = encryptResult.result!; } - async runAsync(): Promise { + async run(): Promise { await CryptographyTest.cryptoClient!.decrypt({ algorithm: this.algorithm, ciphertext: this.cipherText! diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/sign.spec.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/sign.spec.ts index 2e881feddaaf..c6e04368a34b 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/sign.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/sign.spec.ts @@ -11,7 +11,7 @@ export class SignTest extends CryptographyTest { .digest(); } - async runAsync(): Promise { + async run(): Promise { await CryptographyTest.cryptoClient!.sign("RS256", this.digest!); } } diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/unwrapKey.spec.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/unwrapKey.spec.ts index a2548afe7ec7..8e395cafc2bc 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/unwrapKey.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/unwrapKey.spec.ts @@ -14,7 +14,7 @@ export class UnwrapKeyTest extends CryptographyTest { this.encryptedKey = wrapResult.result; } - async runAsync(): Promise { + async run(): Promise { await CryptographyTest.cryptoClient!.unwrapKey(this.wrapAlgorithm, this.encryptedKey!); } } diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts index 982840fc27db..756632d58b55 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts @@ -43,7 +43,7 @@ export abstract class KeyTest extends PerfTest { } export class GetKeyTest extends KeyTest { - async runAsync(): Promise { + async run(): Promise { await this.keyClient.getKey(KeyTest.keyName); } } diff --git a/sdk/keyvault/perf-tests/keyvault-secrets/test/getSecret.spec.ts b/sdk/keyvault/perf-tests/keyvault-secrets/test/getSecret.spec.ts index 66930cd201f6..b98b1c9dd805 100644 --- a/sdk/keyvault/perf-tests/keyvault-secrets/test/getSecret.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-secrets/test/getSecret.spec.ts @@ -10,7 +10,7 @@ export class GetSecretTest extends SecretTest { await this.secretClient.setSecret(GetSecretTest.secretName, "value"); } - async runAsync(): Promise { + async run(): Promise { await this.secretClient.getSecret(GetSecretTest.secretName); } diff --git a/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts b/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts index a2d691b25ac9..6b76afa13ead 100644 --- a/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts @@ -40,7 +40,7 @@ export class ListSecretsTest extends SecretTest { await Promise.all(secretToCreate); } - async runAsync(): Promise { + async run(): Promise { // eslint-disable-next-line no-empty for await (const _secret of this.secretClient.listPropertiesOfSecrets()) { } diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts index 20c36482c1ed..f0960f358128 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts @@ -14,7 +14,7 @@ export class AnomaliesListTest extends MetricsAdvisorTest { + async run(): Promise { const listIterator = this.client.listAnomalies({ alertConfigId: this.alertConfigId, id: this.alertId diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts index 07fca2b61680..9715f15778a6 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts @@ -14,7 +14,7 @@ export class IncidentsListTest extends MetricsAdvisorTest { + async run(): Promise { const listIterator = this.client.listIncidents({ alertConfigId: this.alertConfigId, id: this.alertId diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts index ae1069e5f046..06fd88aaf736 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts @@ -14,7 +14,7 @@ export class RootCauseTest extends MetricsAdvisorTest this.incidentId = getEnvVar("METRICS_ADVISOR_INCIDENT_ID"); } - async runAsync(): Promise { + async run(): Promise { const result = await this.client.getIncidentRootCauses(this.detectionConfigId, this.incidentId); // eslint-disable-next-line no-empty for (const _rootcause of result.rootCauses) { diff --git a/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts index 439e671aea51..67567362d02d 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts @@ -16,7 +16,7 @@ export class LogQueryTest extends MonitorQueryLog { "AppRequests | summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId"; } - async runAsync(): Promise { + async run(): Promise { await this.client.queryWorkspace(this.workspaceId, this.query, { startTime: new Date("2021-07-25"), endTime: new Date("2021-07-26") diff --git a/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts index 025bbd2d0566..e6efd987e1aa 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts @@ -34,7 +34,7 @@ export class LogQueryBatchTest extends MonitorQueryLog ]; } - async runAsync(): Promise { + async run(): Promise { await this.client.queryBatch(this.queryBatch); } } diff --git a/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts index d1e1a20edfba..8937f67141c7 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts @@ -18,7 +18,7 @@ export class MetricsQueryTest extends MonitorQueryMetrics { + async run(): Promise { await this.client.queryResource(this.metricsUri, this.metricNames, { aggregations: this.aggregations }); diff --git a/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts b/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts index 5c00ba06cc46..3aeb51c9475e 100644 --- a/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts @@ -21,7 +21,7 @@ export class AutoCompleteTest extends SearchDocumentsBase { + async run(): Promise { await this.searchClient.autocomplete("historic", this.suggesterName); } } diff --git a/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts b/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts index 84f5d5524b8c..963f936b6f2b 100644 --- a/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts @@ -21,7 +21,7 @@ export class IndexDocumentsTest extends SearchDocumentsBase { + async run(): Promise { for (let i = 0; i < this.hotels.length; i++) { this.hotels[i].hotelId = Math.floor( Math.random() * (this.hotels.length * 2 - this.hotels.length + 1) + this.hotels.length diff --git a/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts b/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts index 371dfba92ed2..5b4c6d384be6 100644 --- a/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts @@ -21,7 +21,7 @@ export class SearchDocumentsTest extends SearchDocumentsBase { + async run(): Promise { await this.searchClient.search(""); } } diff --git a/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts b/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts index fc3663c13367..4a0c2f5fe9a8 100644 --- a/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts @@ -21,7 +21,7 @@ export class SuggestTest extends SearchDocumentsBase await super.populateIndex(this.parsedOptions.documentsCount.value!); } - async runAsync(): Promise { + async run(): Promise { await this.searchClient.suggest("historic", this.suggesterName); } } diff --git a/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts b/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts index 23cf13cb86b5..9137761ea901 100644 --- a/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts +++ b/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts @@ -38,7 +38,7 @@ export class BatchSendTest extends ServiceBusTest { this.batch = new Array(this.parsedOptions.numberOfMessages.value!).fill(sbMessage); } - async runAsync(): Promise { + async run(): Promise { await BatchSendTest.sender.sendBatch(this.batch); } } diff --git a/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts b/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts index af512d53b85f..f2dc713df5c6 100644 --- a/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts +++ b/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts @@ -38,7 +38,7 @@ export class BatchSendTest extends ServiceBusTest { this.batch = new Array(this.parsedOptions.numberOfMessages.value!).fill(sbMessage); } - async runAsync(): Promise { + async run(): Promise { await BatchSendTest.sender.sendMessages(this.batch); } } diff --git a/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts b/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts index 56935ff8613c..39a4c9606c88 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts @@ -41,7 +41,7 @@ export class StorageBlobDownloadTest extends StorageBlobTest { + async run(): Promise { const downloadResponse = await this.blockBlobClient.download(Aborter.none, 0); await drainStream(downloadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts b/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts index 39e5ab1871a7..bf662da7f20d 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts +++ b/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts @@ -31,7 +31,7 @@ export class StorageBlobListTest extends StorageBlobTest { + async run(): Promise { // List blobs let marker = undefined; do { diff --git a/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts b/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts index 95ca85734415..c0dfe19d7c27 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts @@ -30,7 +30,7 @@ export class StorageBlobUploadTest extends StorageBlobTest { + async run(): Promise { await this.blockBlobClient.upload(Aborter.none, this.buffer, this.parsedOptions.size.value!); } } diff --git a/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts b/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts index aff17f7431b6..a565f1171e7b 100644 --- a/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts @@ -28,7 +28,7 @@ export class CoreHTTPDownloadWithSASTest extends StorageBlobDownloadWithSASTest ); } - async runAsync(): Promise { + async run(): Promise { const response = await this.client.sendRequest(this.webResource); await drainStream(response.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts b/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts index 3de80a43f516..66b3c7015547 100644 --- a/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts @@ -22,7 +22,7 @@ export class CoreHTTPSDownloadWithSASTest extends StorageBlobDownloadWithSASTest }); } - async runAsync(): Promise { + async run(): Promise { const response = await this.client.sendRequest(this.request); await drainStream(response.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts b/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts index baf44414e03d..77efa2f9e380 100644 --- a/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts @@ -70,7 +70,7 @@ export class StorageBlobDownloadWithSASTest extends StorageBlobTest< ); } - async runAsync(): Promise { + async run(): Promise { const downloadResponse = await this.blobClientFromSAS.download(); await drainStream(downloadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-blob/test/download.spec.ts b/sdk/storage/perf-tests/storage-blob/test/download.spec.ts index 3070850babe9..731246665c9c 100644 --- a/sdk/storage/perf-tests/storage-blob/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/download.spec.ts @@ -41,7 +41,7 @@ export class StorageBlobDownloadTest extends StorageBlobTest { + async run(): Promise { const downloadResponse = await this.blockBlobClient.download(); await drainStream(downloadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts b/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts index c157f109d070..85e725a73326 100644 --- a/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts @@ -29,7 +29,7 @@ export class StorageBlobListTest extends StorageBlobTest { + async run(): Promise { for await (const segmentResponse of this.containerClient.listBlobsFlat().byPage()) { // eslint-disable-next-line no-empty for (const _ of segmentResponse.segment.blobItems) { diff --git a/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts b/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts index a65ac155cfb3..401df7fafa75 100644 --- a/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts @@ -12,7 +12,7 @@ export class NodeFetchDownloadWithSASTest extends StorageBlobDownloadWithSASTest this.agent = new https.Agent({ keepAlive: true }); } - async runAsync(): Promise { + async run(): Promise { const response = await node_fetch(this.sasUrl, { agent: this.agent }); await drainStream(response.body); } diff --git a/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts b/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts index 6ee36a2bdb21..3ba80f18c718 100644 --- a/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts @@ -28,7 +28,7 @@ export class StorageBlobUploadTest extends StorageBlobTest { + async run(): Promise { await this.containerClient.uploadBlockBlob( this.blobName, this.buffer, diff --git a/sdk/storage/perf-tests/storage-blob/test/uploadFromFile.spec.ts b/sdk/storage/perf-tests/storage-blob/test/uploadFromFile.spec.ts index 1daeed221255..6f4d37b2b9e5 100644 --- a/sdk/storage/perf-tests/storage-blob/test/uploadFromFile.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/uploadFromFile.spec.ts @@ -31,7 +31,7 @@ export class StorageBlobUploadFileTest extends StorageBlobUploadTest { await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { await this.blockBlobClient.uploadFile(fileName); } } diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts index afe05cc6d9d5..548623505cb6 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts @@ -32,7 +32,7 @@ export class StorageDFSAppendTest extends StorageDFSTest { + async run(): Promise { await this.fileClient.append(this.buffer, 0, this.parsedOptions.size.value!); } } diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts index 57e11be25924..b80e82b3516a 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts @@ -32,7 +32,7 @@ export class StorageDFSReadTest extends StorageDFSTest { + async run(): Promise { const ReadResponse = await this.fileClient.read(); await drainStream(ReadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts index 6b386dd5b02a..be3dbb999ede 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts @@ -30,7 +30,7 @@ export class StorageDFSUploadTest extends StorageDFSTest { + async run(): Promise { await this.fileClient.upload(this.buffer); } } diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/uploadFromFile.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/uploadFromFile.spec.ts index 8a4ad73266d7..9fd7c15b80ff 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/uploadFromFile.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/uploadFromFile.spec.ts @@ -24,7 +24,7 @@ export class StorageDFSUploadFromFileTest extends StorageDFSUploadTest { await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { await this.fileClient.uploadFile(localFileName); } } diff --git a/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts b/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts index 1fd3c5ddf3d8..01e09bb07369 100644 --- a/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts @@ -42,7 +42,7 @@ export class StorageFileShareDownloadTest extends StorageFileShareTest< await this.fileClient.uploadRange(Aborter.none, this.buffer, 0, this.parsedOptions.size.value!); } - async runAsync(): Promise { + async run(): Promise { const downloadResponse = await this.fileClient.download(Aborter.none, 0); await drainStream(downloadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts b/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts index b0af193cabcb..7d35c1ca0b4b 100644 --- a/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts @@ -35,7 +35,7 @@ export class StorageFileShareUploadTest extends StorageFileShareTest< await this.fileClient.create(Aborter.none, this.parsedOptions.size.value!); } - async runAsync(): Promise { + async run(): Promise { await this.fileClient.uploadRange(Aborter.none, this.buffer, 0, this.parsedOptions.size.value!); } } diff --git a/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts index 8d6f827a9398..d19511f513f5 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts @@ -35,7 +35,7 @@ export class StorageFileShareDownloadTest extends StorageFileShareTest< await this.fileClient.uploadData(Buffer.alloc(this.parsedOptions.size.value!)); } - async runAsync(): Promise { + async run(): Promise { const downloadResponse = await this.fileClient.download(); await drainStream(downloadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts index 53b327426dc2..73285dacf37d 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts @@ -51,7 +51,7 @@ export class StorageFileShareDownloadToFileTest extends StorageFileShareTest< await deleteFile(`${localDirName}/${this.localFileName}`); } - async runAsync(): Promise { + async run(): Promise { await this.fileClient.downloadToFile(`${localDirName}/${this.localFileName}`, 0); } } diff --git a/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts index 41b3b0410c67..076e9c441762 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts @@ -32,7 +32,7 @@ export class StorageFileShareUploadTest extends StorageFileShareTest< this.buffer = Buffer.alloc(this.parsedOptions.size.value!); } - async runAsync(): Promise { + async run(): Promise { await this.fileClient.uploadData(this.buffer); } } diff --git a/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts index 9c298973fa9d..6261be9aacc4 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts @@ -50,7 +50,7 @@ export class StorageFileShareUploadFromFileTest extends StorageFileShareTest< await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { await this.fileClient.uploadFile(localFileName); } } diff --git a/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts b/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts index b108590b4957..be8cfe7e470e 100644 --- a/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts @@ -18,7 +18,7 @@ export class CreateComplexEntityTest extends TablesTest { await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { const complexEntity: TableEntity = createComplexEntity(); await this.client.createEntity(complexEntity); } diff --git a/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts b/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts index 3894e30ce820..48b9bcb516f0 100644 --- a/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts @@ -31,7 +31,7 @@ export class CreateComplexEntityBatchTest extends TablesTest< await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { const batches: TransactionAction[][] = createBatch( "complex", this.parsedOptions.batchSize.value! diff --git a/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts b/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts index 2ae5b43c853a..b02629abcf3e 100644 --- a/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts @@ -18,7 +18,7 @@ export class CreateSimpleEntityTest extends TablesTest { await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { const simpleEntity: TableEntity = createSimpleEntity(); await this.client.createEntity(simpleEntity); } diff --git a/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts b/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts index d5d25f142d63..5b35bd79d6a2 100644 --- a/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts @@ -31,7 +31,7 @@ export class CreateSimpleEntityBatchTest extends TablesTest< await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { const batches: TransactionAction[][] = createBatch( "simple", this.parsedOptions.batchSize.value! diff --git a/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts b/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts index 80f626f5a783..1da0068a5153 100644 --- a/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts @@ -37,7 +37,7 @@ export class ListComplexEntitiesTest extends TablesTest { + async run(): Promise { const iter = this.client.listEntities(); const entities: TableEntityResult>[] = []; diff --git a/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts b/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts index cf90116d81af..c6b7a894a228 100644 --- a/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts @@ -37,7 +37,7 @@ export class ListSimpleEntitiesTest extends TablesTest { + async run(): Promise { const iter = this.client.listEntities(); const entities: TableEntityResult>[] = []; diff --git a/sdk/test-utils/perf/GettingStarted.md b/sdk/test-utils/perf/GettingStarted.md index 64dc53d23ff0..d2184885314d 100644 --- a/sdk/test-utils/perf/GettingStarted.md +++ b/sdk/test-utils/perf/GettingStarted.md @@ -201,7 +201,7 @@ export class `ServiceNameAPIName`Test extends ServiceNameTest { // Add any additional setup } - async runAsync(): Promise { + async run(): Promise { // call the method on `serviceNameClient` that you're interested in testing } } @@ -231,8 +231,8 @@ export class `ServiceNameAPIName`Test extends ServiceNameTest<`ServiceNameAPINam } }; - async runAsync(): Promise { - // You can leverage the parsedOptions in the setup or globalSetup or runAsync methods as shown below. + async run(): Promise { + // You can leverage the parsedOptions in the setup or globalSetup or run methods as shown below. // this.parsedOptions.duration.value! // this.parsedOptions.newOption.value! } diff --git a/sdk/test-utils/perf/README.md b/sdk/test-utils/perf/README.md index 2a6b26e6408d..3627b3971a0c 100644 --- a/sdk/test-utils/perf/README.md +++ b/sdk/test-utils/perf/README.md @@ -9,13 +9,13 @@ Link to the wiki - [Writing-Performance-Tests](https://github.com/Azure/azure-sd ## KeyConcepts - A **PerfTest** test is a test that will be executed repeatedly to show both the performance of the program, and how it behaves under stress. -- Tests have an asynchronous method called `runAsync` which is executed based on the duration, iterations, and parallel options provided for the perf test. More about options below. +- Tests have an asynchronous method called `run` which is executed based on the duration, iterations, and parallel options provided for the perf test. More about options below. - A **PerfOption** is a command line parameter. We use `minimist` to parse them appropriately, and then to consolidate them in a dictionary of options that is called `PerfOptionDictionary`. The dictionary class accepts a union type of strings that defines the options that are allowed by each test. - Some default options are parsed by the Perf program. Their longer names are: `help`, `no-cleanups`, `parallel`, `duration`, `warmup`, `iterations`, `no-cleanup` and `milliseconds-to-log`. - Perf tests are executed as many times as possible until the `duration` parameter is specified. This process may repeat as many `iterations` are given. Before each iteration, tests might be called for a period of time up to `warmup`, to adjust to possible runtime optimizations. In each iteration, as many as `parallel` instances of the same test are called without waiting for each other, letting the event loop decide which one is prioritized (it's not true parallelism, but it's an approximation that aligns with the design in other languages, we might improve it over time). - Each test can have a `globalSetup` method, which is called once before the process begins, a `globalCleanup` method, which is called once after the process finishes. - Each test can have a `setup` method, which is called as many times as test instances are created (up to `parallel`), and help specify local state for each test instance. A `cleanup` method is also optional, called the same amount of times, but after finishing running the tests. -- `test-proxies` url option - this option can be leveraged to avoid hitting throttling scenarios while testing the services. This option lets the requests go through proxy server(s) based on the url(s) provided, we run runAsync method once in record mode to save the requests and responses in memory and then a ton of times in playback. Workflow with the test-proxies below. +- `test-proxies` url option - this option can be leveraged to avoid hitting throttling scenarios while testing the services. This option lets the requests go through proxy server(s) based on the url(s) provided, we run the `run` method once in record mode to save the requests and responses in memory and then a ton of times in playback. Workflow with the test-proxies below. ## Workflow with test proxy @@ -26,7 +26,7 @@ Steps below constitute the workflow of a typical perf test. - then start record - making a request to the proxy server to start recording - proxy server gives a recording id, we'll use this id to save the actual requests and responses -- run the runAsync once +- run the `run` method once - proxy-server saves all the requests and responses in memory - stop record - making a request to the proxy server to stop recording @@ -34,10 +34,10 @@ Steps below constitute the workflow of a typical perf test. - making a request to the proxy server to start playback - we use the same recording-id that we used in the record mode since that's the only way proxy-server knows what requests are supposed to be played back - As a response, we get a new recording-id, which will be used for future playback requests -- run runAsync again +- run the `run` method again - based on the duration, iterations, and parallel options provided for the perf test - - all the requests in the runAsync method are played back since we have already recorded them before -- when the runAsync loops end, stop playback + - all the requests in the `run` method are played back since we have already recorded them before +- when the `run` loops end, stop playback - making a request to the proxy server to stop playing back - delete the live resources that we have created before diff --git a/sdk/test-utils/perf/src/program.ts b/sdk/test-utils/perf/src/program.ts index c0f29bb9b032..0cda0f9b37f5 100644 --- a/sdk/test-utils/perf/src/program.ts +++ b/sdk/test-utils/perf/src/program.ts @@ -137,12 +137,12 @@ export class PerfProgram { durationMilliseconds: number, abortController: AbortController ): Promise { - if (!test.runAsync) { - throw new Error(`The "runAsync" method is missing in the test ${this.testName}`); + if (!test.run) { + throw new Error(`The "run" method is missing in the test ${this.testName}`); } const start = process.hrtime(); while (!abortController.signal.aborted) { - await test.runAsync(abortController.signal); + await test.run(abortController.signal); const elapsed = process.hrtime(start); const elapsedMilliseconds = elapsed[0] * 1000 + elapsed[1] / 1000000; @@ -287,7 +287,7 @@ export class PerfProgram { } if (this.tests[0].parsedOptions["test-proxies"].value) { - // Records requests(in runAsync method) for all the instantiated PerfTest classes, + // Records requests(in the run method) for all the instantiated PerfTest classes, // and asks the proxy-tool to start playing back for future requests. await Promise.all(this.tests.map((test) => this.recordAndStartPlayback(test))); } @@ -326,7 +326,7 @@ export class PerfProgram { /** * This method records the requests-responses and lets the proxy-server know when to playback. - * We run runAsync once in record mode to save the requests and responses in memory and then a ton of times in playback. + * We run run() once in record mode to save the requests and responses in memory and then a ton of times in playback. * * ## Workflow of the perf test * - test resources are setup @@ -334,7 +334,7 @@ export class PerfProgram { * - then start record * - making a request to the proxy server to start recording * - proxy server gives a recording id, we'll use this id to save the actual requests and responses - * - run the runAsync once + * - run the run method once * - proxy-server saves all the requests and responses in memory * - stop record * - making a request to the proxy server to stop recording @@ -342,17 +342,17 @@ export class PerfProgram { * - making a request to the proxy server to start playback * - we use the same recording-id that we used in the record mode since that's the only way proxy-server knows what requests are supposed to be played back * - as a response, we get a new recording-id, which will be used for future playback requests - * - run runAsync again + * - run the run method again * - based on the duration, iterations, and parallel options provided for the perf test - * - all the requests in the runAsync method are played back since we have already recorded them before - * - when the runAsync loops end, stop playback + * - all the requests in the run method are played back since we have already recorded them before + * - when the run loops end, stop playback * - making a request to the proxy server to stop playing back * - delete the live resources that we have created before */ private async recordAndStartPlayback(test: PerfTest) { // If test-proxy, // => then start record - // => run the runAsync + // => call the run method // => stop record // => start playback let recorder: TestProxyHttpClientV1 | TestProxyHttpClient; @@ -367,11 +367,11 @@ export class PerfProgram { } // Call Run() once before starting recording, to avoid capturing one-time setup like authorization requests. - await test.runAsync!(); + await test.run!(); await recorder.startRecording(); recorder._mode = "record"; - await test.runAsync!(); + await test.run!(); await recorder.stopRecording(); await recorder.startPlayback(); diff --git a/sdk/test-utils/perf/src/testProxyHttpClient.ts b/sdk/test-utils/perf/src/testProxyHttpClient.ts index 21ca5b65ef7d..e37a4fcc9062 100644 --- a/sdk/test-utils/perf/src/testProxyHttpClient.ts +++ b/sdk/test-utils/perf/src/testProxyHttpClient.ts @@ -23,7 +23,7 @@ const paths = { * Helper class to manage the recording state to make sure the proxy-tool is not flooded with unintended requests. * * => then start record - * => run the runAsync + * => run the run method * => stop record * => start playback * => stop playback diff --git a/sdk/test-utils/perf/src/tests.ts b/sdk/test-utils/perf/src/tests.ts index 5c60f4f254bb..78e9b1155df8 100644 --- a/sdk/test-utils/perf/src/tests.ts +++ b/sdk/test-utils/perf/src/tests.ts @@ -71,7 +71,7 @@ export abstract class PerfTest { public setup?(): void | Promise; public cleanup?(): void | Promise; - public async runAsync?(abortSignal?: AbortSignalLike): Promise; + public async run?(abortSignal?: AbortSignalLike): Promise; /** * configureClientOptionsCoreV1 diff --git a/sdk/test-utils/perf/test/delay.spec.ts b/sdk/test-utils/perf/test/delay.spec.ts index a7d1769baec1..1fc3918ce29f 100644 --- a/sdk/test-utils/perf/test/delay.spec.ts +++ b/sdk/test-utils/perf/test/delay.spec.ts @@ -41,7 +41,7 @@ export class Delay500ms extends PerfTest { /** * Waits 500 milliseconds. */ - async runAsync(): Promise { + async run(): Promise { await delay(500); } } diff --git a/sdk/test-utils/perf/test/exception.spec.ts b/sdk/test-utils/perf/test/exception.spec.ts index dccf37cd1566..c7ac565ba8a9 100644 --- a/sdk/test-utils/perf/test/exception.spec.ts +++ b/sdk/test-utils/perf/test/exception.spec.ts @@ -11,7 +11,7 @@ import { PerfTest } from "../src"; export class Exception extends PerfTest { public options = {}; - async runAsync(): Promise { + async run(): Promise { try { throw new Error(); } catch (e) { diff --git a/sdk/test-utils/perf/test/nodeFetch.spec.ts b/sdk/test-utils/perf/test/nodeFetch.spec.ts index 26d62cf48017..24f462066210 100644 --- a/sdk/test-utils/perf/test/nodeFetch.spec.ts +++ b/sdk/test-utils/perf/test/nodeFetch.spec.ts @@ -32,7 +32,7 @@ export class NodeFetchTest extends PerfTest { this.url = this.options.url.value as string; } - async runAsync(): Promise { + async run(): Promise { const response = await fetch(this.url, NodeFetchTest.fetchOptions); await response.text(); } diff --git a/sdk/test-utils/perf/test/noop.spec.ts b/sdk/test-utils/perf/test/noop.spec.ts index 0fb963ccdb22..bab32d4aad9d 100644 --- a/sdk/test-utils/perf/test/noop.spec.ts +++ b/sdk/test-utils/perf/test/noop.spec.ts @@ -9,5 +9,5 @@ import { PerfTest } from "../src"; export class NoOp extends PerfTest { public options = {}; - async runAsync(): Promise {} + async run(): Promise {} } diff --git a/sdk/test-utils/perf/test/options.spec.ts b/sdk/test-utils/perf/test/options.spec.ts index 8729283dcb5d..7a1c7bf65847 100644 --- a/sdk/test-utils/perf/test/options.spec.ts +++ b/sdk/test-utils/perf/test/options.spec.ts @@ -71,7 +71,7 @@ export class OptionsTest extends PerfTest { } } - async runAsync() { + async run() { for (const key in this.options) { this.compare(key as keyof OptionsTestOptions); } diff --git a/sdk/test-utils/perf/test/perfPolicy.spec.ts b/sdk/test-utils/perf/test/perfPolicy.spec.ts index f023f988f092..fda670ce5d04 100644 --- a/sdk/test-utils/perf/test/perfPolicy.spec.ts +++ b/sdk/test-utils/perf/test/perfPolicy.spec.ts @@ -32,7 +32,7 @@ export class PerfPolicyTest extends PerfTest { shortName: "u" } }; - async runAsync(): Promise { + async run(): Promise { const targetUrl = url.parse(this.parsedOptions.url.value!); const differentUrl = url.parse(this.parsedOptions.url.value!); differentUrl.host = `not-${differentUrl.host}`; diff --git a/sdk/test-utils/perf/test/serviceClientGet.spec.ts b/sdk/test-utils/perf/test/serviceClientGet.spec.ts index c37f64dad32e..9ed6442cb109 100644 --- a/sdk/test-utils/perf/test/serviceClientGet.spec.ts +++ b/sdk/test-utils/perf/test/serviceClientGet.spec.ts @@ -49,7 +49,7 @@ export class ServiceClientGetTest extends PerfTest { } } - async runAsync(): Promise { + async run(): Promise { var response; if (this.firstRun) { diff --git a/sdk/test-utils/perf/test/setupCleanup.spec.ts b/sdk/test-utils/perf/test/setupCleanup.spec.ts index 1c5949cbba01..6c3c0940eb1d 100644 --- a/sdk/test-utils/perf/test/setupCleanup.spec.ts +++ b/sdk/test-utils/perf/test/setupCleanup.spec.ts @@ -47,5 +47,5 @@ export class SetupCleanupTest extends PerfTest { } } - async runAsync() {} + async run() {} } diff --git a/sdk/test-utils/perf/test/sleep.spec.ts b/sdk/test-utils/perf/test/sleep.spec.ts index b9cf02cadb94..5cebcff5b863 100644 --- a/sdk/test-utils/perf/test/sleep.spec.ts +++ b/sdk/test-utils/perf/test/sleep.spec.ts @@ -21,7 +21,7 @@ export class SleepTest extends PerfTest { this.secondsPerOperation = Math.pow(2, SleepTest.instanceCount); } - async runAsync(): Promise { + async run(): Promise { await delay(this.secondsPerOperation * 1000); } } diff --git a/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts b/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts index e8cd7f484481..d7dfde24cf83 100644 --- a/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts +++ b/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts @@ -49,7 +49,7 @@ export class DetectLanguageTest extends PerfTest this.client = new TextAnalyticsClient(endpoint, credential); } - async runAsync(): Promise { + async run(): Promise { await this.client.detectLanguage(this.docs, "en"); } }