* chore(deps): bump got from 14.6.6 to 15.0.5
Bumps [got](https://github.com/sindresorhus/got) from 14.6.6 to 15.0.5.
- [Release notes](https://github.com/sindresorhus/got/releases)
- [Commits](https://github.com/sindresorhus/got/compare/v14.6.6...v15.0.5)
---
updated-dependencies:
- dependency-name: got
dependency-version: 15.0.5
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
* migrate got promise.cancel to AbortController
breaking changes of got v14 -> v15 dropped cancel() and replaced with AbortController signal
* tests: replace 'undici' FormData with native FormData
due to got migration from v14 -> v15 usage of non native FormData is unsupported.
* fix: url usage in got.post
* fix: adjust clock tick duration in metrics test
* improve test robustness
use a promise to wait for custom metrics push to resolve rathrer then rely on timers
* fix: move abortController from function to fetch instance
* remove old comment
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jNullj <15849761+jNullj@users.noreply.github.com>
Because `server.js` was long a monolith, there are a bunch of shims in place to facilitate unit testing. A few of the test suites share port 1111 which means if one of them fails to set up, the port won't be freed and other unrelated tests will fail. Some of the tests which trigger server setup include timeouts which were added to give setup code time to run. In one the test suites, we actually modify `process.argv`, which seems completely gross.
This implements a few changes which improve this:
1. Separate the server from the server startup script, splitting out `lib/server.js`.
2. Inject config into the server and validate the config schema.
3. Inject config into the service test runner.
4. Use `portfinder`, a popular utility for grabbing open ports during testing.
5. Switch more of the setup code from callbacks to async-await.
Overall it leaves everything acting more reliably and looking rather cleaner, if in a few places more verbose.
It also fixes the root cause of #1455, a `setTimeout` in `rate-limit`. Off and on during development of this changeset, Mocha would decide not to exit, and that turned out to be the culprit.
Fix#1455