Граф коммитов

1124 Коммитов

Автор SHA1 Сообщение Дата
Jeremy Meng ffe81c5bcf [EngSys] upgrade dev dependency `mkdirp` to `^3.0.1`
***NO_CI***
2024-04-15 11:27:58 -07:00
Jeremy Meng 398494acd8 [EngSys] upgrade dev dependency `typescript` to `~5.4.5`
The only package that still stays on ~5.3.3 is search-document (tracked by issue #29283)

***NO_CI***
2024-04-11 23:19:38 +00:00
Harsha Nalluru 09fac3709c
[Perf] Fix service-bus and event-hubs perf pipelines (#29124)
### Packages impacted by this PR
perf packages for `service-bus` and `event-hubs`

### Issues associated with this PR
Perf pipelines failing
### Before
SB:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3655620&view=results
<img
src="https://github.com/Azure/azure-sdk-for-js/assets/10452642/fc837fea-5ed4-41c4-abb5-f667b47e9dd8"
height=300>
EH:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3655391&view=results

### After
SB:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3654751&view=results
<img
src="https://github.com/Azure/azure-sdk-for-js/assets/10452642/4565cdb2-f4de-4ff4-92be-1827024e72be"
height=300>
EH:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3654747&view=results
2024-04-01 21:17:05 +00:00
Maor Leger d7173879bf [EngSys] C8 major version update ***NO_CI*** 2024-03-22 13:26:43 -05:00
Harsha Nalluru 8d3374a81a
[Perf] Make perf package public for consumption outside this repo (#28916)
### Packages impacted by this PR
`@azure-tools/test-perf`

### Describe the problem that is addressed by this PR
Making perf package public for consumption outside this repo.
This marks the initial release of the `@azure-tools/test-perf` library
to npm, providing a robust test utility framework that assists with the
performance testing of Azure SDKs for JS/TS.

### Key Concepts

1. **Introduction of PerfTest**: A test utility designed to execute
performance and stress tests for Azure SDK for JavaScript packages.
2. **Test Execution**: Tests are run asynchronously, influenced by
parameters like duration, iterations, and parallelism.
3. **Command Line Parameters**: Utilizes `minimist` for parsing command
line options into a `PerfOptionDictionary<string>` for test
configuration.
4. **Default Options**: Includes standard parameters such as `help`,
`no-cleanups`, `parallel`, `duration`, `warmup`, `iterations`,
`no-cleanup`, and `milliseconds-to-log`.
5. **Test Lifecycle**: Tests run repeatedly within the specified
`duration` and `iterations`, with a `warmup` period for runtime
optimization.
6. **Setup and Cleanup**: Features `globalSetup`/`globalCleanup` methods
for CPU-level preparation and `setup`/`cleanup` methods for
instance-specific state management.
2024-03-19 10:05:34 +00:00
Scott Beddall (from Dev Box) ecdb45e61d replace all tests.yml usage w/ extends to archetype-sdk-tests.yml ***NO_CI*** 2024-03-11 14:13:06 -07:00
Matthew Podwysocki ca72dcf5c9 [EngSys] move to rimraf 5 ***NO_CI*** 2024-03-07 16:48:30 -08:00
Deyaaeldeen Almahallawi fef5c5c562
[core-amqp] Update error from retry (#28751)
### Packages impacted by this PR
@azure/core-amqp

### Issues associated with this PR
N/A

### Describe the problem that is addressed by this PR
The errors thrown between retries could differ and the customer wouldn't
be able to know them unless they enable logging.

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
Another design is to provide an error handler callback to be called on
all errors but since it is an extreme measure, we can revisit this
latter if we get an ask for it.

### Are there test cases added in this PR? _(If not, why?)_
N/A

### Provide a list of related PRs _(if any)_
N/A

### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [x] Added a changelog (if necessary)

---------

Co-authored-by: Jeff Fisher <jeffish@microsoft.com>
2024-03-04 22:24:16 -08:00
Maor Leger 4415ff81a7
[EngSys] Bump puppeteer to 22.2.0 (#28639)
Looks like Google updated their URLs for chrome for testing downloads,
planning to retire the `hdgedl.me.gvt1.com...` URLs with
`storage.googleapis.com` URLs

It may have been deprecated for quite some time, but looks like as of
last night the old URLs have died, returning 500 instead.

As a result, puppeteer postinstall breaks the build

According to https://github.com/puppeteer/puppeteer/issues/11967
puppeteer 22.2.0 already uses the new URLs which
we can easily upgrade to.

This PR bumps the min-version to 22.2.0 across the board.
2024-02-22 18:49:19 +00:00
Jeremy Meng 5b750f88cf
[ServiceBus] wait up to max wait time for draining credit when receiving messages (#28604)
We added a timeout of 200 milliseconds on credit draining before
returning from `receiveMessages()`. There's customer report that
indicates this timeout is aggressive in environment with slow network
and caused link churn because we close link when draining times out to
avoid going into a bad state.

This PR changes the wait time to the max of 200 ms and the remaining
portion of the `maxWaitTimeInMs` option that is passed to
`receiveMessages()`, allowing customer to customize the time out
indirectly.


### Packages impacted by this PR
`@azure/service-bus`

### Issues associated with this PR
#28023 

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
- exposing an option to set drain timeout. This is not desired since
waiting for draining is an internal implementation detail
- increase 200 ms to some other higher value. It's not possible to
determin a best value for this as environments are different.
- adaptive behavior that adjust the wait time dynamically based on how
frequently the link was closed due to time out. This can leads to
complicate logic.
2024-02-20 10:28:56 -08:00
Jeremy Meng cd4d6b9f6f
[EngSys] switch to use `esm4mocha` loader by default for *.js tests (#28589)
- Switch to use esm4mocha loader by default
- Add `--use-esm-workaround=true` to packages that need more work
(mostly due to usage of `__dirname` that is no longer available in ESM)
- Change some usage of `__dirname` to `"."` when possible
- [esm4mocha] only transform modules whose format is changed
- [load-testing-rest] update tsconfig.json to be consistent with other
packages
2024-02-16 14:37:24 -08:00
Jeremy Meng b82222b3e1
[EngSys] add a workaround to load ESM tests for Mocha (#28556)
Currently most of our '*.js' tests and sources under dist-esm/ are
transformed by `esm` package (now outdated and archived) before being
feeded to Mocha because when a package.json has `"type":
"commonjs"` thus Mocha treats `.js` files as CommonJS.

This PR takes another approach by telling Mocha that the loaded modules
under dist-esm/ are ESM via a custom loader (`esm4mocha.mjs`).
This is done mainly in two parts:

1. During resolving, this loader checks the path of resolved modules and
if it includes `"dist-esm/"` we set the format of the resolved module to
`"module"`.
2. Also in ESM the full extension is required for relative modules in
import/export declarations, so a transformation is applied
to add `".js"` extension to relative imports/exports on the fly when
loading the module.

ServiceBus integration-test:node script has been updated to use this
approach. For now, the dev-tool command is unrolled and the old
workaround is replaced by the new one:

```diff
- -r ../../../common/tools/esm-workaround -r esm
+ --loader=../../../common/tools/esm4mocha.mjs
```

In the future, the dev-tool command would be updated to use the new
workaround for the majority of our packages.
2024-02-13 19:35:37 -08:00
Jeremy Meng b705d89332
[EngSys] pin http(s)-proxy-agent versions (#28568)
The latest versions broke our tests:

```
> mocha -r ../../../common/tools/esm-workaround.js -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js  --reporter-option output=test-results.xml --timeout 1200000 --full-trace "dist-esm/test/internal/**/*.test.js"

/home/meng/git/jssdk/common/temp/node_modules/.pnpm/https-proxy-agent@7.0.3/node_modules/https-proxy-agent/dist/index.js:1
Error: Cannot find module 'node:url'
Require stack:
- /home/meng/git/jssdk/common/temp/node_modules/.pnpm/https-proxy-agent@7.0.3/node_modules/https-proxy-agent/dist/index.js
- /home/meng/git/jssdk/sdk/core/core-rest-pipeline/dist/index.js
- /home/meng/git/jssdk/sdk/monitor/monitor-opentelemetry-exporter/dist-esm/src/platform/nodejs/httpSender.js
...
```
2024-02-13 14:24:49 -08:00
Matthew Podwysocki fadd8a78e3
[messaging] Update https-proxy-agent (#28564)
### Packages impacted by this PR

- @azure/event-hubs
- @azure/service-bus

### Issues associated with this PR

- https://github.com/Azure/azure-sdk-for-js/security/dependabot/49

### Describe the problem that is addressed by this PR

Updates with the latest `https-proxy-agent` which does not have the
vulnerability.

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
2024-02-13 19:04:28 +00:00
Azure SDK Bot 0175e739cd
Post release automated changes for servicebus releases (#28496)
Post release automated changes for azure-service-bus
2024-02-06 20:56:27 +00:00
Jeremy Meng 09784c3724 [EngSys] upgrade dev dependency `pretter` to `^3.2.5`
There's some changes in 3.2.5 which caused formatting changes for tsconfig.json
which caused our rush automation failed in check-format when moving to latest 3.2.5.

https://github.com/prettier/prettier/blob/main/CHANGELOG.md#use-json-parser-for-tsconfigjson-by-default-16012-by-sosukesuzuki

This change upgrades prettier to version ^3.2.5 and format files using "rush format".

***NO_CI***
2024-02-06 12:13:14 -08:00
Jeremy Meng 18d6d50c67
[EngSys] upgrade dev dependency `puppeteer` to `^22.0.0` (#28200)
by running `rush add -m --dev -p puppeteer@^22.0.0`

- adjust core-xml test due puppeteer switched from Chromium to Chrome
- ignore Accept-Language headers for browser playback tests

Resolves https://github.com/Azure/azure-sdk-for-js/issues/25790
2024-02-06 12:05:36 -08:00
Jeremy Meng d0a773eea3
[ServiceBus] prepare for February 2024 (#28409)
- update release date in CHANGELOG
2024-02-06 11:11:28 -08:00
Maor Leger c0d505f086 [EngSys] Update to @azure/identity 4.x
This change migrates every package to the latest major version of
identity in order to ensure we can catch any regressions earlier in the
development process.

I chose to upgrade the samples' package.json as well - but happy to
revert that if there are objections.

***NO_CI***
2024-02-02 19:01:35 +00:00
Jeremy Meng fb74e0b24b [EngSys] ensure dev dependency `@types/mocha` when depending on `mocha`
Our tests use the type `Mocha.Context` when they need to pass the test context
to test recorder. However, without a dev dependency on `@types/mocha`
compilation may fail when recorder constructor is changed from taking a
`Mocha.Test` to taking an interface that is compatible.

This change ensures the dev depedency on `@types/mocha` too if there's a dev
dependency on `mocha`.

***NO_CI***
2024-02-02 18:41:28 +00:00
Jeremy Meng ee5c29d72d ***NO_CI***
bump to ~5.3.3
2024-01-26 11:25:48 -08:00
Matthew Podwysocki f70fa9821c [EngSys] Update TypeScript to 5.3 2024-01-26 11:25:47 -08:00
Jeremy Meng ef9a34ab3f
Use "License" instead of "Licence" in file header (#28360)
Though both are correct (US version and non-US version), our repo mostly
uses "License". This PR updates the occurrance of "Licence" with
"License" to be consistent and make our linter happy.
2024-01-24 12:30:19 -08:00
Jeremy Meng 0e1c8881f0 [EngSys] upgrade dev dependency `prettier` version to ^3.2.4
***NO_CI***

Latest versions of prettier now correctly formats `tsconfig.json`, which results
in differences with previous version of 3.1.1 in pnpm-lock.yaml. This is failing
the automated rush update pipeline because `check-format` fails with version
3.2.4.

This includes changes of
- bumping prettier version to ^3.2.4
- running `rush format`
2024-01-18 19:05:41 +00:00
Jeremy Meng 0e72afdf20
[ServiceBus] bump runtime dependency core-amqp version to ^4.1.1 (#28258)
This ensures we can use the newly added constants `maxUint32Value`
2024-01-16 14:05:42 -08:00
Jeremy Meng 4cd97298d6
[core-amqp, service-bus] Correct timeToLive calculation to use absolute expiry time (#28178)
Following the .NET fix
https://github.com/Azure/azure-sdk-for-net/pull/40916

### Packages impacted by this PR
`@azure/core-amqp`, `@azure/service-bus`

### Issues associated with this PR
#28121 

### Describe the problem that is addressed by this PR

When a message is received, if the absolute expiry time was set on the
AMQP message, the TTL should be set using the difference between the
absolute expiry time and the message creation time. This works around
the limitation of the AMQP spec where a value larger than 49 days in
milliseconds cannot be sent over the wire as the field is a uint32. Also
currently JS SDK throws an error if a TTL value of larger than 49 days
in milliseconds value is set on messages to send.

Both core-amqp and service-bus are fixed because service-bus has its own
`fromRheaMessage` and `toRheaMessage` to enable configuring JSON body
parsing behavior and Date conversion.
2024-01-12 23:28:22 +00:00
Jeremy Meng 12b4dcc257 [EngSys] upgrade to prettier v3
***NO_CI***

- remove dev dependency `prettier` from non-tool packages when possible and
  update them to run vendored prettier for `check-format` and `format` scripts

- upgrade rest of packages to prettier v3

- run `rush format` for all rush packages

This is a follow-up to https://github.com/Azure/azure-sdk-for-js/pull/28127 to
move the rest of repo to prettier v3.
2024-01-10 18:45:01 -05:00
Jeremy Meng 0d5d2c5438
[EngSys] upgrade dev dependency `dotenv` to version `^16.0.0` (#28119)
Most of packages have been updated as well as codegen. This RP upgrades
left-over packages.

Resolves #19217
2023-12-29 18:31:57 +00:00
Jeremy Meng ee9a6e72ec
[ServiceBus] add prefix to locks (#28058)
to improve logging.  This is similar to other existing lock tokens.
2023-12-15 16:49:17 -08:00
Matthew Podwysocki 881ded52fd [EngSys] Remove Downlevel-DTS ***NO_CI*** 2023-12-06 23:05:44 +00:00
Jeremy Meng f6e6736d3a [EngSys] remove dev dependency `mocha-junit-reporter`
***NO_CI***

We have replaced it with Mocha builtin XUnit reporter in PR https://github.com/Azure/azure-sdk-for-js/pull/27992
2023-12-06 22:28:15 +00:00
Jeremy Meng 4d8911e5a7
[core] remove core-http from main branch (#27994)
We plan to deprecate `@azure/core-http` soon and it has been maintained
and released from `sotrage/stable` branch for a while. This PR removes
it from main branch of the repo.

- remove sdk/core/core-http directory
- update references to core-http in documentation
- publish communication-sms samples so previous change of moving from
core-http to core-util is reflected.
2023-12-05 15:40:11 -08:00
Jeremy Meng 6d2c6389a1
[ServiceBus] auto-complete message first before adding credit (#27634)
Otherwise this could occur:

- message handler completes
- one credit added
- while we are completing the message, the same message arrives again
since there's one credit, and the message hasn't been settled.

### Packages impacted by this PR
@azure/service-bus
2023-11-28 19:16:53 -08:00
Jeremy Meng facc44641b
[EngSys] upgrade dev dependency @types/sinon to ^17.0.0 (#27836)
and sinon too to ^17.0.0 for packages that missed last upgrade.
2023-11-17 14:54:01 -08:00
Jeremy Meng 7850e7a28e
[ServiceBus] await error handler in session receiver (#27716)
Currently in session receiver, we fire-and-forget user's error handler
instead of awaiting it. This is causing problems when customer want to
modify state in message handler, and want to roll back in case of error
as currently we would carry on to abandon the message when error
happens, then add credit. The same message could arrive and processed,
while the error handling is still going on.

This PR changes it to wait for user error handler before proceeding.
This behavior of awaiting user error handler is in line with our
streaming receiver and other languages.
2023-11-10 09:30:04 -08:00
Azure SDK Bot 5505913c2b
Post release automated changes for servicebus releases (#27687)
Post release automated changes for azure-service-bus
2023-11-08 00:07:15 +00:00
Jeremy Meng ec304cc76f
[ServiceBus] Prepare for November 2023 release (#27623)
- update CHANGELOG
2023-11-07 11:00:22 -08:00
Jeremy Meng c6dbe7ef23
[EngSys] upgrade dep dependency `sinon` version to `^17.0.0` (#27601) 2023-11-02 17:14:17 +00:00
Jeremy Meng d44ad35a73
[EngSys] Fix format checking error (#27602)
Some files are not formated in commits that were merged without CI. This
PR updates them with the result from `rush format`, and also fixes
`format` script for ts-http-runtime
2023-10-31 17:27:38 +00:00
Jeremy Meng 09111131ef [EngSys] Increment minimum supported node version to v18
***NO_CI***

- React to @types/node changes
- Fix eslint-plugin tests
2023-10-30 21:01:37 +00:00
Jeremy Meng 4a1fb70f66
[ServiceBus] Throw a retryable error when sending message and link is detached (#27557)
It's possible that after we create the sender link, but before using it
to send message, the link gets closed for example due to bad network
condition. Our current code would throw a type error when accessing
`send()` method of the undefined `link`. The error is not retryable.

This PR checks for valid link again before calling `link.send()` and
throw an new retryable client error.
2023-10-26 11:02:29 -07:00
Jeremy Meng 4371e976b1 [engsys] replace dev dependency `nyc` with `c8`
***NO_CI***

The combination of `nyc` + `esm` is broken in latest versions of
NodeJS (https://github.com/istanbuljs/nyc/issues/1530#issuecomment-1773403365).
Since `esm` package is no longer actively maintained and its repo is archived,
it's less likely that the issue will be fixed soon.

This change switches to use another code coverage tool `c8` which is not
affected. `c8` respects `.nycrc` config files so those are not renamed.
2023-10-23 17:08:26 -04:00
Jeremy Meng 6d7f6359cb [engsys] update dev dependency `typescript` version to `~5.2.0`
***NO_CI***

- Upgrade typedoc too as older version only supports TypeScript 5.0
2023-10-23 14:32:05 -04:00
Deyaaeldeen Almahallawi 72d460d5ba Use dev-tool bundle in arm libraries ***NO_CI*** 2023-10-16 21:03:26 +00:00
Jeremy Meng 5e757f7745
[ServiceBus] revert to old order of checking parameters for scheduleMessages (#27421)
Service Bus live tests failed due to the switched ordering of parameter
type checking for `messages` and `scheduledEnqueueTimeUtc`. Even though
this is unlikely a real world scenario where users would passing in
undefined `messages` before a valid `scheduledEnqueueTimeUtc`, this PR
restores the old order to presrve the existing behavior.
2023-10-16 12:36:52 -07:00
Jeremy Meng 5cb4184040
[ServiceBus] throw error for invalid `scheduledEnqueueTimeUtc` (#27396)
to `scheduleMessages()`.

The service ignores the value when it is not valid. This may surprise
JavaScript developers who pass in a datetime string and expect it to
work. This adds an `instanceof` check to only accept `Date` instances
2023-10-13 11:31:56 -07:00
Azure SDK Bot 7e8ee506a8
Post release automated changes for servicebus releases (#27378)
Post release automated changes for azure-service-bus
2023-10-10 23:37:44 +00:00
Jeremy Meng e6fc8980f7
[ServiceBus] Prepare for Oct. 2023 release (#27367)
- Update CHANGELOG
2023-10-10 10:51:02 -07:00
Deyaaeldeen Almahallawi e1b30ef8d3
[Service Bus] Upgrade rollup to v3 (#27363)
[Successful live
test](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3150973&view=results)

### Packages impacted by this PR
@azure/service-bus

### Issues associated with this PR
https://github.com/Azure/azure-sdk-for-js/issues/26665

### Describe the problem that is addressed by this PR
Upgrade rollup from v2 to v3

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
N/A

### Are there test cases added in this PR? _(If not, why?)_
N/A

### Provide a list of related PRs _(if any)_
https://github.com/Azure/azure-sdk-for-js/pull/27305

### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
2023-10-10 09:35:47 -07:00
Jeremy Meng c65d843a30 Increment minimum supported node version to 16
***NO_CI***

- update engine.node to >=16.0.0 in package.json
- update @types/node version to ^16.0.0
- update dev-tool sample's MIN_SUPPORTED_NODE_VERSION to 16
- update eslint-plugin's rules and tests related to engine.node version
- remove TextEncoder and TextDecoder stubs as they are now on global object
- fix tests compiler error due to better typings in v16
- update some README files to not reference version like 14.x.x
2023-10-09 21:09:54 +00:00
Jeremy Meng 57cd99f813
[ServiceBus] throw error earlier when timing out (#27308)
Related: issue #9775, #27010

This PR fixed the following timing issue when trying to establish link
for next session but there are none available.

what's happening is

- SDK is trying to create a link for next avaiable session
(`options.source.filter: { com.microsoft:session-filter': undefined }`)
- Because no sessions are available, after one minute, a link is
established, but with `"source":null,"target":null`. The call to create
link resolves.
- However, the service immediately use that link to ask SDK to close the
link, with an error of `"com.microsoft:timeout"`/`The operation did not
complete within the allotted timeout of 00:00:59.9130000.`
- SDK respects the request and start acquiring a lock to close the link
- Meanwhile, SDK gets a link, nice! It will continue as the link has
been created
- SDK gets lock to close link and sets `this._link` to `undefined` and
start closing receiver and amqp session
- SDK null-check the link and throws INTERNAL ERROR

Instead of returning the link in this case, This PR checks whether we
got a session id back. If not and there's an error from service, we
rethrow the error. Some of the existing error handling is also moved
before returning the link, instead of afterwards.

### Are there test cases added in this PR? _(If not, why?)_
There's one test covers this scenario and verifies two possible errors.
28cbcd053d/sdk/servicebus/service-bus/test/public/sessionsTests.spec.ts (L81)
2023-10-03 17:49:50 -07:00
kazrael2119 ab391b646b
[mgmt] update quick-start link in changelog (#27260)
https://github.com/Azure/azure-sdk-for-js/pull/27223#discussion_r1338094846
2023-09-27 17:51:50 +08:00
Jeremy Meng b2dfb59d59 [test] upgrade dev dependency `mocha` to `^10.0.0`
- along with it, `@types/mocha` version to `^10.0.0`
- add `esm` dev dependency as they are used, but not explicitly list
- use dev-tool run command for test scripts as much as possible
- fix test issue caused by Mocha behavior change around test name
- move `import "chai/register-should"` to mocha -r command line option for core
  http tests

***NO_CI***
2023-09-26 18:54:14 +00:00
Deyaaeldeen Almahallawi 7470b33951
[Messaging] Bump core-amqp dependency to v4 (#27232)
### Packages impacted by this PR
@azure/event-hubs, @azure/service-bus

### Issues associated with this PR
N/A

### Describe the problem that is addressed by this PR
Bump @azure/core-amqp dependency in both from v3 to v4.

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
N/A

### Are there test cases added in this PR? _(If not, why?)_
N/A

### Provide a list of related PRs _(if any)_
N/A

### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
2023-09-25 13:48:06 -07:00
Azure SDK Bot 4c943014fa
Post release automated changes for servicebus releases (#27080)
Post release automated changes for azure-service-bus
2023-09-25 11:03:17 -07:00
Deyaaeldeen Almahallawi e95422bbd0 Fix up Azure dependencies ***NO_CI*** 2023-09-22 18:38:37 +00:00
Jeremy Meng b6fe0179fd
[test] disable code coverage temporarily (#27129)
Latest NodeJS versions broke nyc. This PR disables it temporarily.

https://github.com/istanbuljs/nyc/issues/1530

An workitem is logged to track re-enabling it after the issue is
resolved.

https://github.com/Azure/azure-sdk-for-js/issues/27128
2023-09-15 09:22:01 -07:00
Jeremy Meng 1cd0daa460
[ServiceBus] prepare for 2023 September release (#27034)
- update release date in CHANGELOG
2023-09-06 15:06:15 -07:00
Jeremy Meng c85d973b9f
[ServiceBus] wait and throw error if sender link is not sendable (#26927)
We already have the logic in `MessageSender._trySend()`. This PR adds
the same to `ManagementClient._makeManagementRequest()` so that when the
link is not sendable, we wait for one second then check again. A
`SendBusyError` is thrown if we still cannot send messages.

### Packages impacted by this PR
`@azure/service-bus`

### Issues associated with this PR

#26855
2023-08-28 15:22:51 -07:00
Jeremy Meng 56d2330abe [EngSys] add `ts-node` dev dependencies to rush projects
***NO_CI***

Most of our packages, if not all, have dev dependency on `ts-node` either
directly (`mocha --require ts-node/register`) or indirectly via dev-tool (`run
test:node-ts-input`). Currently tests are running fine because mocha is able to
resolve ts-node currently. It may fail in other cases though (e.g., after
migrating a package to ESM).

This ensures `ts-node@^10.0.0` and `types/node` are included for our rush
packages.
2023-08-23 14:36:24 -07:00
Harsha Nalluru 414d5adb40
[Perf Tests] [AMQP] Test naming consistency update (#26674)
For consistent naming across languages
2023-08-08 14:34:44 -07:00
Jeremy Meng 0d9f89ac90
[engsys] upgrade dev dependency `sinon` and `@types/sinon` (#26622)
- update `sinon` version to `^15.0.0`. The breaking changes does not
affect our usages.
- upgrade `@types/sinon` to `^10.0.0`. This reveals test issue where
mocked tokens are not compatible with `AccessToken`. This PR fixes the
tests too.
2023-07-27 09:54:37 -07:00
Harsha Nalluru ef3d6277f5
[Service Bus] Update SB stress tests - based on recent testing (#25658)
# Stress tests for Service Bus - Update
Based on the recent investigations at #25572, below are a few changes
that help run stress tests better with relevant insights.
- adds memory metrics
- doesn't track message ids, to not have memory noise
- tracks message count
2023-06-07 11:29:32 -07:00
Jeremy Meng aae738b05a
[Docs][EH,SB] update README to not install buffer and process for browsers (#26101)
As they are dependencies of the libraries and will be installed when
installing EH or SB packages.
2023-06-05 16:11:22 -07:00
Harsha Nalluru c9efe56e58
[Event Hubs] Add stress tests to event-hubs SDK (#25661)
# Stress tests for Event Hubs
- Adds the stress testing framework to the Event Hubs SDK.
- Adds the relevant tests from
https://gist.github.com/HarshaNalluru/2f1931ea30e8335678310053aa342db0
that have helped in the recent memory-leak investigations.
- Follows the patterns from the service-bus stress tests
- In sync with SB after
https://github.com/Azure/azure-sdk-for-js/pull/25658
- tracks message count
- tracks memory metrics

## EventHubsStressTester 
- Sets up Application Insights for logging and tracking events.
- `EventHubsStressTester` class has methods for initializing the test,
taking snapshots of test progress, and ending the test.
- `loopForever` takes a function fn, a delay duration, and an optional
abort signal as arguments. The function enters a loop that calls fn
repeatedly with a delay between each call until the abort signal is
triggered or times out.

## noActivity test
- **Initialization**: The main function `scenarioNoActivity` creates
instances of Event Hubs consumer and producer clients and subscribes to
all partitions of the consumer client with handlers for processing
events, errors, initialization, and closing.
- **Execution**: The producer sends a batch of two events and starts a
loop that checks if the test duration has been reached or if any of the
subscribers have stopped running.
- **Cleanup**: If either condition is met, the loop exits and the
producer and consumer clients are closed. The stress test is ended by
calling the `endTest` method on the `stressBase` instance.

## getRuntimeProperties test
- **Initialization**: The main function `scenarioGetRuntimeProperties`
creates instances of Event Hubs consumer and producer clients and a
`stressBase` instance for stress testing.
- **Execution**: The function defines an asynchronous function `func`
that enters a loop and repeatedly calls the `getEventHubProperties`
method on the consumer client with a random delay between each call. The
function then creates an array of 100 promises that resolve when `func`
completes and waits for all promises to resolve.
- **Cleanup**: Once all promises have resolved, the producer and
consumer clients are closed and the stress test is ended by calling the
`endTest` method on the `stressBase` instance.

## checkpoint store test
- **Initialization**: The main function `scenarioCheckpointStore`
creates instances of Event Hubs consumer and producer clients, a
`stressBase` instance for stress testing, and a `BlobCheckpointStore`
instance for storing checkpoints. The consumer client subscribes to the
default consumer group with handlers for processing events, errors,
initialization, and closing.
- **Execution**: The function enters a loop that sends a batch of random
events using the producer client and waits for a random delay between
each iteration. The loop checks if the test duration has been reached or
if the subscription has stopped running.
- **Cleanup**: If either condition is met, the loop exits and the
producer and consumer clients are closed. The stress test is ended by
calling the `endTest` method on the `stressBase` instance.

---------

Co-authored-by: Deyaaeldeen Almahallawi <dealmaha@microsoft.com>
2023-06-04 00:46:19 +00:00
kazrael2119 63bfb1cd0c
migrate sdk recording files 3 (#25679)
https://github.com/Azure/azure-sdk-for-js/issues/25410
2023-04-28 16:49:05 +08:00
Matthew Podwysocki 190524c11c
[event hubs] Update OTEL to latest spec (#25597)
### Packages impacted by this PR

- @azure/event-hubs

### Issues associated with this PR


### Describe the problem that is addressed by this PR

Updating to latest [OTEL messaging
standards](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/messaging.md#messaging-attributes).
This is also explained in a gist from @lmolkova
[here](https://gist.github.com/lmolkova/e4215c0f44a49ef824983382762e6b92)

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_

- #25492

### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
2023-04-20 18:11:03 +00:00
Matthew Podwysocki 0b08a4fa20
[service bus] Updating to latest OTEL for Messaging (#25492)
### Packages impacted by this PR

- @azure/service-bus

### Issues associated with this PR


### Describe the problem that is addressed by this PR

Updating to latest [OTEL messaging
standards](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/messaging.md#messaging-attributes).
This is also explained in a gist from @lmolkova
[here](https://gist.github.com/lmolkova/e4215c0f44a49ef824983382762e6b92)



### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [x] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)

---------

Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
2023-04-19 00:27:49 +00:00
Jeremy Meng d3a06a7349 [EngSys] upgrade dev dependency `typescript` to `~5.0.0`
***NO_CI***

- update versions in package.json
- change a couple ^ version to ~ version because typescript doesn't follow semver
2023-04-18 23:04:26 +00:00
Azure SDK Bot 7484a9aa01
Post release automated changes for servicebus releases (#25530)
Post release automated changes for azure-service-bus
2023-04-11 11:36:12 -07:00
Jeremy Meng d9e540b6b7
[docs] add links to React Native samples for some tested packages (#25324) 2023-04-06 16:17:25 -07:00
Jeremy Meng 7a0e78c33a
[ServiceBus] prepare for 2023 April release (#25465)
- update release date
2023-04-05 12:40:15 -07:00
Jeremy Meng dbe2e74a27
[ServiceBus] add timeout around receiver drain when receiving messages (#25355)
This is a port of PR https://github.com/Azure/azure-sdk-for-js/pull/8239

From original PR description:
>This change attempts to remove an edge case where `receiveMessages` may
hang indefinitely.
>
>Currently, once the `BatchingReceiver` (`receiveMessages`) reaches
either the `maxMessageCount` or `maxWaitTime`, it will drain any
remaining credits on the receiver link and then return the messages.
>
>However if for some reason the service was unable to report back that
credits were drained, the messages would never be returned and the
operation would appear to hang indefinitely.
>
>Now the receiver will wait a maximum of 200 ms for the service to
indicate that credits are drained. If this timeout is reached, then the
received messages are returned from `receiveMessages`.
>
>I chose 200 ms because in my local testing, it typically took ~80 ms
between when the receiver triggered a drain and when the
`receiver_drained` event was fired. This gives an additional 150%
buffer. I had considered using `newMessageWaitTimeoutInSeconds` instead,
which currently is set to 1 second, but was trying to minimize how long
we'd wait so that message locks wouldn't need to be renewed.

In addition to porting the changes, I also update some existing tests to
work well with the new behavior, and reduced their execution time by
shorten the max waiting time.
2023-03-30 13:40:38 -07:00
Jeremy Meng dee392ecca
[ServiceBus] add drainCredit timeout when suspending receiver (#25369)
There are cases where the service doesn't respond to our drain-credit
request, or the response comes back after a long and unexpected time.
Since we are blocking on the `receiver_drained` event before resolving,
application code could be blocked indefinitely when suspending/closing.

This PR adds a timeout around credit draining, and if the time limit
expires we close the receiver then returns.
2023-03-27 15:18:58 -07:00
Jeremy Meng b64e591c19
[ServiceBus] Fix issue sending message body of `Uint8Array` (#25349)
We should treat `Uint8Array` message body similar to what we do with
`Buffer`.

Fixes #25336

Related Event Hubs PR: #21185
2023-03-22 17:31:15 -07:00
Jeremy Meng 2468efd47a
[ServiceBus] Fix a race condition in generating replyTo and initializing link (#25279)
When a link is not ready for sending management request we will
initialize it
and a unique `replyTo` address is generated. The problem is the two
steps are
separate and only the link initialization is guarded by a lock to ensure
the
link is only initialized once. When multiple management requests are
made at the
same time, multiple `replyTo` addresses could be generated but only one
is
associated with the link, resulting in errors like

```
ServiceBusError: The response link '0f6cd6e7-16d1-034a-b661-5d632917cd50' was not found in the entity management node $management.
```

This PR groups the two parts into one locked operation, thus preventing
multiple
`replyTo` addresses from being generated for a new link.

- add a failing test without fix
- Move initialization code out of `_makeManagementRequest()` into a
locked block together with code to generate unique `replyTo`
2023-03-20 11:20:51 -07:00
Jeremy Meng 03478a4480
[amqp messaging] bump dependency @azure/core-amqp version to ^3.3.0 (#25251)
to ensure v3 rhea and rhea-promise transitive dependencies.
2023-03-14 14:21:12 -07:00
Jeremy Meng 3c0ff9c2da
[ServiceBus] when batch-receiving add credit when needed (#25185)
instead of always adding credit of `maxMessageCount`. Otherwise, in the
case of user aborting the call then re-receive, we keep adding excessive
credits.
2023-03-13 10:17:12 -07:00
Harsha Nalluru 6ffe27137c
[Service Bus] [Stress Tests] Fix build failure - chart.yaml (#24977)
Issue - https://github.com/Azure/azure-sdk-for-js/issues/24976

Following Go -
8000b7a347/sdk/messaging/azservicebus/internal/stress/Chart.yaml (L11)
2023-03-08 14:23:24 -08:00
Jeremy Meng 66ea1d82e9
[core-amqp,event-hubs,service-bus] upgrade `rhea-promise` dependency version to `^3.0.0` (#25070) 2023-03-08 10:24:33 -08:00
Azure SDK Bot f7dbd901c7
Post release automated changes for servicebus releases (#25145)
Post release automated changes for azure-service-bus
2023-03-07 19:27:26 +00:00
Jeremy Meng ae26cc9d92 [engsys] remove karma ie and edge launcher
as we no longer need to test them.

***NO_CI***
2023-03-06 17:08:15 -05:00
Jeff Fisher b1509d6756 Update test-recorder to drop support for `@Azure/core-http` and
bump the major version accordingly.

***NO_CI***
2023-03-02 15:21:26 -08:00
Jeremy Meng b3851f860c
[ServiceBus] Prepare for 2023 March release (#25055)
- update CHANGELOG
2023-03-01 15:07:02 -08:00
Jeremy Meng e405a37e77
[ServiceBus][Test] enable detailed logging in live test pipeline (#24852)
There's little impact to the total running time of the pipeline. We get
larger logs but it should provide big help on diagnosing failures.
2023-02-28 09:46:48 -08:00
Matthew Podwysocki b4b260511b
[EngSys] Update minimist to 1.26+ (#25028)
### Packages impacted by this PR

- devtool
- test-utils
- service-bus stress test

### Issues associated with this PR

https://github.com/Azure/azure-sdk-for-js/security/dependabot/18

### Describe the problem that is addressed by this PR

Updating minimist to fix the security issue as noted in
https://github.com/Azure/azure-sdk-for-js/security/dependabot/18

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?


### Are there test cases added in this PR? _(If not, why?)_


### Provide a list of related PRs _(if any)_


### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_

### Checklists
- [ ] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [ ] Added a changelog (if necessary)
2023-02-28 12:41:52 -05:00
Jeremy Meng d05ae7979f
[ServiceBus] pass `skipParsingBodyAsJson` and `skipConvertingDate` options to peek operations (#24950)
Currently the two options only affect `receiveMessages()`. This PR pass
them to peek operations as well so the received messages are consistent.
2023-02-23 10:04:43 -08:00
Azure SDK Bot 87c52a862a
Post release automated changes for servicebus releases (#24924)
Post release automated changes for azure-arm-servicebus
2023-02-21 04:22:19 +00:00
Jeremy Meng 42d359f404 [engsys] upgrade @rollup plugins dev dependencies
***NO_CI***

- `@rollup/plugin-commonjs` to `^24.0.0`
- `@rollup/plugin-json` to `^6.0.0`
- `@rollup/plugin-multi-entry` to `^6.0.0`
- `rollup-plugin-polyfill-node` to `^0.12.0`
- `@rollup/plugin-inject` to `^5.0.0`
- `@rollup/plugin-replace` to `^5.0.0`

Fix notification-hubs rollup test config: now sourcemaps plugin is complaining
about .ts file. Move typescript plugin before it.

Fix service-bus to include needed rollup dependencies. It was lucky to be able
to re-use on other packages to install them but is failing in some builds.
2023-02-10 15:12:48 -08:00
Jeremy Meng ab536fc39a [engsys] make typescript version consistent to ~4.8.0
***NO_CI***

This is the result of

- `rush add --dev -m -p typescript@~4.8.0`

- and update versions in non-rush projects
2023-02-10 11:41:53 -08:00
kazrael2119 7b07e38b64
servicebus release (#24780)
https://github.com/Azure/sdk-release-request/issues/3733
2023-02-10 16:30:09 +08:00
Mike Harder ffe09dd9a1
[Perf] Refactor tests.yml into one file per package per language (#24398) 2023-02-09 21:17:31 -08:00
Azure SDK Bot 6471580910
Post release automated changes for servicebus releases (#24767)
Post release automated changes for azure-service-bus
2023-02-07 21:53:59 +00:00
Jeremy Meng e432cd2964
[ServiceBus] parepare for 2023 February release (#24659) 2023-02-01 17:18:13 -08:00
Jeremy Meng c3c2cd3a24
[ServiceBus] Add option to preserve Date type when receiving messages (#24539)
* [ServiceBus] Add option to preserve Date type when receiving messages

For compatibility reason we convert Date properties into epoch numbers even
though the underlying rhea library supports Date type now.

This PR adds an option to keep the Date type when receiving messages. By default
we still convert properties of Date type into numbers.

* bump minor version and update CHANGELOG
2023-01-30 16:27:20 -08:00
Jeremy Meng 2683958acc
[engsys] fix check-format errors (#24575)
The changes in this PR is the result of `rush format`
2023-01-27 02:28:43 +00:00
Jeremy Meng bbb29823c9 [engsys] upgrade dev dependency `dotenv` version to `^16.0.0`
***NO_CI***
2023-01-26 15:59:56 -08:00
Jeremy Meng f266acd55b
[ServiceBus] improve auto lock renew logging when stopping (#24561)
* [sb] improve auto lock renew logging

previously the two cases share same log message, which can be confusing. This PR
separate them to have different log messages.

* Move negative cases first

to improve readability.  Having them at the end makes it hard to relate them
with their corresponding conditions

* Format
2023-01-25 16:26:35 -08:00
Harsha Nalluru ca56c427d3
[Service Bus] Add perf pipeline (#23819)
* starter code

* service-bus perf pipeline

* checkpoint

* Revert "checkpoint"

This reverts commit 057e5e829f.

* test update

* copy stress resource

* Update sdk/servicebus/service-bus/perf.yml

* body - message

* Improve defaults in perf.yml

* Fix typo in regex

* Add receive-batch to tests

* ["inherit", "inherit", "inherit", "ipc"]

* close the sender too

* Update sdk/test-utils/perf/src/multicore.ts

* changelog

* Revert "Update sdk/test-utils/perf/src/multicore.ts"

This reverts commit 2717a000d6.

* Revert "changelog"

This reverts commit 2e3bdc2aec.

* remove console.log

* Revert "["inherit", "inherit", "inherit", "ipc"]"

This reverts commit 829ea40f26.

Co-authored-by: Mike Harder <mharder@microsoft.com>
2023-01-19 16:37:51 -08:00
Jeremy Meng 9d3364c8c5
[ServiceBuss] Ensure unique `replyTo` when new link is needed (#24509)
Some errors (e.g., `MessageSizeExceeded`) would close the underlying rhea link.
Currently we have a `replyTo` property that is initialized when constructing the
management client and remains unchanged. However, this leads to the following
error when attempting to re-establish a new link:

```
InvalidOperationError: A link with the same 'attach.target.address' value '504c8ecd-6f73-1b4e-9108-d1e12fc3ac9f' address has been already registered to the entity management node $management.
```

This PR ensure that whenever we send a request, if we are going to establish a
new link, the `replyTo` property has a unique value.

Fixes #24476
2023-01-19 10:52:06 -08:00