Skip to content
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

chore(deps): upgrade supertest and superagent #163716

Merged
merged 8 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@
"@types/source-map-support": "^0.5.3",
"@types/stats-lite": "^2.2.0",
"@types/styled-components": "^5.1.0",
"@types/supertest": "^2.0.5",
"@types/supertest": "^2.0.12",
"@types/tapable": "^1.0.6",
"@types/tar": "^6.1.5",
"@types/tempy": "^0.2.0",
Expand Down Expand Up @@ -1536,8 +1536,8 @@
"style-loader": "^1.1.3",
"stylelint": "^14.9.1",
"stylelint-scss": "^4.3.0",
"superagent": "^3.8.2",
"supertest": "^3.1.0",
"superagent": "^8.0.9",
"supertest": "^6.3.3",
"supports-color": "^7.0.0",
"svgo": "^2.8.0",
"tape": "^5.0.1",
Expand Down
44 changes: 40 additions & 4 deletions src/core/server/integration_tests/http/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,16 @@ describe('KibanaRequest', () => {
// end required to send request
.end();

setTimeout(() => incomingRequest.abort(), 50);
setTimeout(() => {
incomingRequest.abort();

// Hack to resolve superagent's bug https://github.com/ladjs/superagent/pull/1774
// Can be removed once a new version is published and we upgrade.
// @ts-expect-error
incomingRequest.req.destroyed = false;
// @ts-expect-error
incomingRequest.req.destroy();
}, 50);
await done;
expect(nextSpy).toHaveBeenCalledTimes(1);
});
Expand Down Expand Up @@ -227,7 +236,16 @@ describe('KibanaRequest', () => {
// end required to send request
.end();

setTimeout(() => incomingRequest.abort(), 50);
setTimeout(() => {
incomingRequest.abort();

// Hack to resolve superagent's bug https://github.com/ladjs/superagent/pull/1774
// Can be removed once a new version is published and we upgrade.
// @ts-expect-error
incomingRequest.req.destroyed = false;
// @ts-expect-error
incomingRequest.req.destroy();
}, 50);
await done;
expect(nextSpy).toHaveBeenCalledTimes(1);
});
Expand Down Expand Up @@ -366,7 +384,16 @@ describe('KibanaRequest', () => {
.get('/')
// end required to send request
.end();
setTimeout(() => incomingRequest.abort(), 50);
setTimeout(() => {
incomingRequest.abort();

// Hack to resolve superagent's bug https://github.com/ladjs/superagent/pull/1774
// Can be removed once a new version is published and we upgrade.
// @ts-expect-error
incomingRequest.req.destroyed = false;
// @ts-expect-error
incomingRequest.req.destroy();
}, 50);
await done;
expect(nextSpy).toHaveBeenCalledTimes(1);
});
Expand Down Expand Up @@ -401,7 +428,16 @@ describe('KibanaRequest', () => {
.send({ foo: 'bar' })
// end required to send request
.end();
setTimeout(() => incomingRequest.abort(), 50);
setTimeout(() => {
incomingRequest.abort();

// Hack to resolve superagent's bug https://github.com/ladjs/superagent/pull/1774
// Can be removed once a new version is published and we upgrade.
// @ts-expect-error
incomingRequest.req.destroyed = false;
// @ts-expect-error
incomingRequest.req.destroy();
}, 50);
await done;
expect(nextSpy).toHaveBeenCalledTimes(1);
});
Expand Down
12 changes: 12 additions & 0 deletions src/core/server/integration_tests/metrics/server_collector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ describe('ServerMetricsCollector', () => {
const waitFor1stAbort = disconnectAborted$.pipe(take(1)).toPromise();

discoReq1.abort();
// Hack to resolve superagent's bug https://github.com/ladjs/superagent/pull/1774
// Can be removed once a new version is published and we upgrade.
// @ts-expect-error
discoReq1.req.destroyed = false;
// @ts-expect-error
discoReq1.req.destroy();

// Wait for the aborted$ event
await waitFor1stAbort;
Expand All @@ -133,6 +139,12 @@ describe('ServerMetricsCollector', () => {
const waitFor2ndAbort = disconnectAborted$.pipe(take(1)).toPromise();

discoReq2.abort();
// Hack to resolve superagent's bug https://github.com/ladjs/superagent/pull/1774
// Can be removed once a new version is published and we upgrade.
// @ts-expect-error
discoReq2.req.destroyed = false;
// @ts-expect-error
discoReq2.req.destroy();

// Wait for the aborted$ event
await waitFor2ndAbort;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ describe('APMEventClient', () => {
}, 100);
});
incomingRequest.abort();

// Hack to resolve superagent's bug https://github.com/ladjs/superagent/pull/1774
// Can be removed once a new version is published and we upgrade.
// @ts-expect-error
incomingRequest.req.destroyed = false;
// @ts-expect-error
incomingRequest.req.destroy();
}, 100);
});

Expand Down
107 changes: 69 additions & 38 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9710,7 +9710,7 @@
"@types/cookiejar" "*"
"@types/node" "*"

"@types/supertest@^2.0.5":
"@types/supertest@^2.0.12":
version "2.0.12"
resolved "https://registry.yarnpkg.com/@types/supertest/-/supertest-2.0.12.tgz#ddb4a0568597c9aadff8dbec5b2e8fddbe8692fc"
integrity sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==
Expand Down Expand Up @@ -12991,11 +12991,16 @@ compare-versions@^6.0.0:
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.1.0.tgz#3f2131e3ae93577df111dba133e6db876ffe127a"
integrity sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==

component-emitter@^1.2.0, component-emitter@^1.2.1:
component-emitter@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6"
integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=

component-emitter@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==

compress-commons@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-4.1.1.tgz#df2a09a7ed17447642bad10a85cc9a19e5c42a7d"
Expand Down Expand Up @@ -13172,7 +13177,7 @@ cookie@^0.5.0:
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b"
integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==

cookiejar@^2.1.0:
cookiejar@^2.1.4:
version "2.1.4"
resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.4.tgz#ee669c1fea2cf42dc31585469d193fef0d65771b"
integrity sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==
Expand Down Expand Up @@ -14575,6 +14580,14 @@ dezalgo@^1.0.0:
asap "^2.0.0"
wrappy "1"

dezalgo@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.4.tgz#751235260469084c132157dfa857f386d4c33d81"
integrity sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==
dependencies:
asap "^2.0.0"
wrappy "1"

dfa@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/dfa/-/dfa-1.2.0.tgz#96ac3204e2d29c49ea5b57af8d92c2ae12790657"
Expand Down Expand Up @@ -16307,6 +16320,11 @@ fast-safe-stringify@^2.0.7:
resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz#dc2af48c46cf712b683e849b2bbd446b32de936f"
integrity sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==

fast-safe-stringify@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884"
integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==

fast-shallow-equal@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fast-shallow-equal/-/fast-shallow-equal-1.0.0.tgz#d4dcaf6472440dcefa6f88b98e3251e27f25628b"
Expand Down Expand Up @@ -16766,15 +16784,6 @@ fork-ts-checker-webpack-plugin@^6.0.4:
semver "^7.3.2"
tapable "^1.0.0"

form-data@^2.3.1:
version "2.5.0"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.5.0.tgz#094ec359dc4b55e7d62e0db4acd76e89fe874d37"
integrity sha512-WXieX3G/8side6VIqx44ablyULoGruSde5PNTxoUyo5CeyAMX6nVWUd0rgist/EuX655cjhUhTo1Fo3tRYqbcA==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.6"
mime-types "^2.1.12"

form-data@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f"
Expand Down Expand Up @@ -16814,10 +16823,15 @@ formdata-polyfill@^4.0.10:
dependencies:
fetch-blob "^3.1.2"

formidable@^1.2.0:
version "1.2.2"
resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.2.2.tgz#bf69aea2972982675f00865342b982986f6b8dd9"
integrity sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==
formidable@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/formidable/-/formidable-2.1.2.tgz#fa973a2bec150e4ce7cac15589d7a25fc30ebd89"
integrity sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==
dependencies:
dezalgo "^1.0.4"
hexoid "^1.0.0"
once "^1.4.0"
qs "^6.11.0"

formik@^2.2.9:
version "2.2.9"
Expand Down Expand Up @@ -17922,6 +17936,11 @@ heap@^0.2.6:
resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac"
integrity sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw=

hexoid@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/hexoid/-/hexoid-1.0.0.tgz#ad10c6573fb907de23d9ec63a711267d9dc9bc18"
integrity sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==

highlight.js@^10.1.1, highlight.js@~10.4.0:
version "10.4.1"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.4.1.tgz#d48fbcf4a9971c4361b3f95f302747afe19dbad0"
Expand Down Expand Up @@ -21593,7 +21612,7 @@ merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1:
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==

methods@^1.1.1, methods@^1.1.2, methods@~1.1.2:
methods@^1.1.2, methods@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=
Expand Down Expand Up @@ -21708,11 +21727,16 @@ mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17,
dependencies:
mime-db "1.51.0"

mime@1.6.0, mime@^1.4.1:
mime@1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==

mime@2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367"
integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==

mime@^2.4.4:
version "2.5.2"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe"
Expand Down Expand Up @@ -24600,13 +24624,20 @@ qs@6.9.7:
resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.7.tgz#4610846871485e1e048f44ae3b94033f0e675afe"
integrity sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==

qs@^6.10.0, qs@^6.5.1, qs@^6.7.0:
qs@^6.10.0, qs@^6.7.0:
version "6.11.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a"
integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==
dependencies:
side-channel "^1.0.4"

qs@^6.11.0:
version "6.11.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9"
integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==
dependencies:
side-channel "^1.0.4"

qs@~6.5.2:
version "6.5.3"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad"
Expand Down Expand Up @@ -27868,21 +27899,21 @@ success-symbol@^0.1.0:
resolved "https://registry.yarnpkg.com/success-symbol/-/success-symbol-0.1.0.tgz#24022e486f3bf1cdca094283b769c472d3b72897"
integrity sha1-JAIuSG878c3KCUKDt2nEctO3KJc=

superagent@^3.8.2, superagent@^3.8.3:
version "3.8.3"
resolved "https://registry.yarnpkg.com/superagent/-/superagent-3.8.3.tgz#460ea0dbdb7d5b11bc4f78deba565f86a178e128"
integrity sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==
superagent@^8.0.5, superagent@^8.0.9:
version "8.0.9"
resolved "https://registry.yarnpkg.com/superagent/-/superagent-8.0.9.tgz#2c6fda6fadb40516515f93e9098c0eb1602e0535"
integrity sha512-4C7Bh5pyHTvU33KpZgwrNKh/VQnvgtCSqPRfJAUdmrtSYePVzVg4E4OzsrbkhJj9O7SO6Bnv75K/F8XVZT8YHA==
dependencies:
component-emitter "^1.2.0"
cookiejar "^2.1.0"
debug "^3.1.0"
extend "^3.0.0"
form-data "^2.3.1"
formidable "^1.2.0"
methods "^1.1.1"
mime "^1.4.1"
qs "^6.5.1"
readable-stream "^2.3.5"
component-emitter "^1.3.0"
cookiejar "^2.1.4"
debug "^4.3.4"
fast-safe-stringify "^2.1.1"
form-data "^4.0.0"
formidable "^2.1.2"
methods "^1.1.2"
mime "2.6.0"
qs "^6.11.0"
semver "^7.3.8"

supercluster@^8.0.1:
version "8.0.1"
Expand All @@ -27898,13 +27929,13 @@ superjson@^1.10.0:
dependencies:
copy-anything "^3.0.2"

supertest@^3.1.0:
version "3.4.2"
resolved "https://registry.yarnpkg.com/supertest/-/supertest-3.4.2.tgz#bad7de2e43d60d27c8caeb8ab34a67c8a5f71aad"
integrity sha512-WZWbwceHUo2P36RoEIdXvmqfs47idNNZjCuJOqDz6rvtkk8ym56aU5oglORCpPeXGxT7l9rkJ41+O1lffQXYSA==
supertest@^6.3.3:
version "6.3.3"
resolved "https://registry.yarnpkg.com/supertest/-/supertest-6.3.3.tgz#42f4da199fee656106fd422c094cf6c9578141db"
integrity sha512-EMCG6G8gDu5qEqRQ3JjjPs6+FYT1a7Hv5ApHvtSghmOFJYtsU5S+pSb6Y2EUeCEY3CmEL3mmQ8YWlPOzQomabA==
dependencies:
methods "^1.1.2"
superagent "^3.8.3"
superagent "^8.0.5"

supports-color@8.1.1, supports-color@^8.0.0, supports-color@^8.1.1:
version "8.1.1"
Expand Down