Conversation
…ock dependency, migrate cache_test to MockAgent
|
This is really great progress on modernizing the project. Thanks for working on it. |
thanks! i was trying to remove nock so we can consolidate testing into undici mockagent and it snowballed |
… errors, add exponential backoff + integration test
60b46b0 to
7a25b4f
Compare
|
|
||
| await this.applyOptions(httpsOptions); | ||
|
|
||
| if (cluster && cluster.skipTLSVerify) { |
There was a problem hiding this comment.
Should we be deleting this?
There was a problem hiding this comment.
my reasoning is that the applyOptions call above invokes applyHTTPSOptions, which sets httpsOptions.rejectUnauthorized
this is mirrored into agentOptions below by agentOptions.rejectUnauthorized = httpsOptions.rejectUnauthorized;
servername is similarly applied in applyOptions > applyHTTPSOptions, but was missing the httpsOptions -> agentOptions conversion in this function which i've now added below along with a test calling the whole chain to assert the TLS propagation
happy to reasses my interpretation or refactor to improve readability
| strictEqual(doneCalled, 1); | ||
| }); | ||
|
|
||
| it('should call setKeepAlive on the socket to extend the default of 5 mins', async (t) => { |
There was a problem hiding this comment.
Does this test no longer apply?
There was a problem hiding this comment.
it appears undici default keepalive is 60s which could still cause a race condition on some load balancers.
reintroduced updated test in config to keep 30s keepalive
|
Generally looks good, some comments on sleep() usage in one of the tests and a couple of things that I'm not sure why they were removed. |
cjihrig
left a comment
There was a problem hiding this comment.
This LGTM. I'll hold off on merging in case others want to weigh in first.
| this.listFn = listFn; | ||
| this.labelSelector = labelSelector; | ||
| this.fieldSelector = fieldSelector; | ||
| this.delayFn = options?.delayFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms))); |
There was a problem hiding this comment.
My only real comment is that you could use the node:timers/promises version of setTimeout() in a few places in this PR if you want, but it's optional.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cjihrig, davidgamero The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| // ApiException expects { [key: string]: string } whereas some fetch implementations provide: { [key: string]: string[] } | ||
| // https://github.com/node-fetch/node-fetch/issues/783 | ||
| // https://github.com/node-fetch/node-fetch/pull/1757 | ||
| export function normalizeResponseHeaders(response: { headers: { entries(): Iterable<[string, string]> } }): { |
There was a problem hiding this comment.
Is this function still needed with undici? I remember adding it specifically for node-fetch.
node-fetch removals
auth
watch
informer