Describe the bug
The timeout option of RequestOptionsBase, if sent to an http request over the browser, is not properly working, as in: the timeout never happens, the request goes through as if this option wasn't present.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The requests should trigger the timeout.
Why didn't we such issues with storage-packages, we don't have tests in storage that covers this?
@sadasant, can you provide me with a branch that repros this?
For reference - https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/keyvault/keyvault-certificates/test/CRUD.test.ts#L79-L97 from @sadasant
So, the test is being currently run only in node and live, rest of the combinations fail.
Here's something interesting.
If we set the following keyvault-keys to .only (and remove any conditionals around them), they do pass on record and playback for Node:
it.only("can create a key with requestOptions timeout", async function() {
}
it.only("can create a RSA key with requestOptions timeout", async function() {
}
it.only("can create an EC key with requestOptions timeout", async function() {
}
However, if after doing that one does .only to a previously passing test (I mean one that would already pass on record and playback on master), that test passes, but the others with .only don't. Example: Let's say we add .only on the first test of that file:
it.only("can create a key while giving a manual type", async function() {
}
Then that one will pass, and the others with timeout will crash.
I closed this by mistake.
The issue is requestOptions timeout test is failing in the browser while it succeeds in node.

The test expects AbortError to be thrown.
Upon some digging through the internals of it in core-http, found this..
In node, we do a setTimeout with abort().

In browser, we are throwing a new error instead of the AbortError - This is the only difference.

This is the reason for the test failure.
Closing with #7159
Scoping this issue to core-http browser issue.
Logging separate issues for node and browser playback.