-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[load-testing-rest] pass PolledOperationOptions to getLongRunningPoller #35164
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
base: main
Are you sure you want to change the base?
Conversation
This PR passes PolledOperationOptions to getLongRunningPoller, allowing customers to change the interval between polls.
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.
Pull Request Overview
This PR enhances the load testing REST client by adding support for PolledOperationOptions
to the getLongRunningPoller
function, enabling customers to customize polling intervals for long-running operations.
- Updated
getLongRunningPoller
function signatures to accept optionalPolledOperationOptions
parameter - Modified test files to use optimized polling intervals (0ms in playback mode, default otherwise)
- Updated API surface documentation to reflect the new optional parameter
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
src/pollingHelper.ts |
Added PolledOperationOptions parameter to all getLongRunningPoller overloads and passes it to underlying poller functions |
test/public/node/testRun.spec.ts |
Added test polling configuration and updated calls to use the new parameter |
test/public/node/testAdministration.spec.ts |
Added test polling configuration and updated calls to use the new parameter |
review/load-testing.api.md |
Updated public API documentation to reflect the new optional parameter |
polledOperationOptions: PolledOperationOptions = {}, | ||
): Promise<TestRunCompletionPoller | FileUploadAndValidatePoller | TestProfileRunCompletionPoller> { | ||
if (isFileUpload(initialResponse)) { | ||
return getFileValidationPoller(client, initialResponse); | ||
return getFileValidationPoller(client, initialResponse, polledOperationOptions); | ||
} else if (isTestRunCreation(initialResponse)) { | ||
return getTestRunCompletionPoller(client, initialResponse); | ||
return getTestRunCompletionPoller(client, initialResponse, polledOperationOptions); | ||
} else if (isTestProfileRunCreation(initialResponse)) { | ||
return getTestProfileRunCompletionPoller(client, initialResponse); | ||
return getTestProfileRunCompletionPoller(client, initialResponse, polledOperationOptions); |
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 implementation overload should use the same optional parameter pattern as the public overloads. Change polledOperationOptions: PolledOperationOptions = {}
to polledOperationOptions?: PolledOperationOptions
for consistency.
Copilot uses AI. Check for mistakes.
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.
We want a default value of {}
): Promise<TestRunCompletionPoller | FileUploadAndValidatePoller | TestProfileRunCompletionPoller> { | ||
if (isFileUpload(initialResponse)) { | ||
return getFileValidationPoller(client, initialResponse); | ||
return getFileValidationPoller(client, initialResponse, polledOperationOptions); |
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.
When polledOperationOptions
is undefined (due to the suggested change above), this will pass undefined
to getFileValidationPoller
. Use polledOperationOptions || {}
or similar to ensure a valid options object is passed.
Copilot uses AI. Check for mistakes.
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 has a default value of {}
return getFileValidationPoller(client, initialResponse, polledOperationOptions); | ||
} else if (isTestRunCreation(initialResponse)) { | ||
return getTestRunCompletionPoller(client, initialResponse); | ||
return getTestRunCompletionPoller(client, initialResponse, polledOperationOptions); | ||
} else if (isTestProfileRunCreation(initialResponse)) { | ||
return getTestProfileRunCompletionPoller(client, initialResponse); | ||
return getTestProfileRunCompletionPoller(client, initialResponse, polledOperationOptions); |
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.
When polledOperationOptions
is undefined, this will pass undefined
to getTestRunCompletionPoller
. Use polledOperationOptions || {}
or similar to ensure a valid options object is passed.
Copilot uses AI. Check for mistakes.
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 has a default value of {}
} else if (isTestProfileRunCreation(initialResponse)) { | ||
return getTestProfileRunCompletionPoller(client, initialResponse); | ||
return getTestProfileRunCompletionPoller(client, initialResponse, polledOperationOptions); |
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.
When polledOperationOptions
is undefined, this will pass undefined
to getTestProfileRunCompletionPoller
. Use polledOperationOptions || {}
or similar to ensure a valid options object is passed.
Copilot uses AI. Check for mistakes.
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 has a default value of {}
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
This PR passes PolledOperationOptions to getLongRunningPoller, allowing customers to change the interval between polls.