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

build(deps-dev): bump nock from 13.5.6 to 14.0.0 #2182

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jan 27, 2025

Bumps nock from 13.5.6 to 14.0.0.

Release notes

Sourced from nock's releases.

v14.0.0

BREAKING CHANGES

  • drop support for Node < 18

Features

v14.0.0-beta.19

14.0.0-beta.19 (2024-12-04)

Bug Fixes

  • backport: memory leaks due to timer references outliving the timers (#2773) (#2773) (66eb7f4)
  • call fs.createReadStream lazily (#2357) (ba9fc42)
  • remove duplicates from activeMocks() and pendingMocks() (#2356) (7e957b3)
  • support literal query string (#2590) (4162fa8)
  • types: return type of BackOptions.afterRecord (#2782) (fc90bd3)

v14.0.0-beta.18

14.0.0-beta.18 (2024-11-25)

Bug Fixes

  • recorder: recompress fetch body on record (#2810) (be35f23)

v14.0.0-beta.17

14.0.0-beta.17 (2024-11-21)

Bug Fixes

  • fetch: add support for aborting requests using AbortSignal (#2809) (a143911)

v14.0.0-beta.16

14.0.0-beta.16 (2024-11-14)

Bug Fixes

  • fetch: support Content-Encoding response header (#2797) (451e69c)
Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Jan 27, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dependabot[bot]
Once this PR has been reviewed and has the lgtm label, please assign davidgamero for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 27, 2025
@brendandburns
Copy link
Contributor

@cjihrig test failiures appear to be related to:

nock/nock#2813

We are trying to simulate a socket error part-way through a watch, I think that we need to modify that code, I played around with it some but I couldn't (yet) figure out the right way to simulate it with the new stack.

I'll keep trying, but if you have any ideas, that'd be great too.

@cjihrig
Copy link
Contributor

cjihrig commented Jan 31, 2025

Yea, I had this on my list of things to look into. I'll move it up the list 😄

I'm pretty certain we will need to make some changes to this code anyway. These two tests are also causing problems updating to node-fetch v3 (and presumably native fetch in the future). I wrote up my findings on that in #2146 (comment).

@cjihrig
Copy link
Contributor

cjihrig commented Feb 1, 2025

Bisecting nock releases points to v14.0.0-beta.8, which only has one commit (unfortunately a complex one): nock/nock#2517

Looking more closely at that particular release, and the v14.0.0 release, it appears that a new mock implementation was swapped in under the hood. There were a number of tests moved into a skipped state to address edge cases - maybe this is one of those edge cases.

@brendandburns
Copy link
Contributor

@dependabot rebase

(I'm hopeful that the update to fetch v3 comparability will fix this)

Bumps [nock](https://github.com/nock/nock) from 13.5.6 to 14.0.0.
- [Release notes](https://github.com/nock/nock/releases)
- [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md)
- [Commits](nock/nock@v13.5.6...v14.0.0)

---
updated-dependencies:
- dependency-name: nock
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/npm_and_yarn/nock-14.0.0 branch from 065f89b to 6076633 Compare February 1, 2025 16:38
@cjihrig
Copy link
Contributor

cjihrig commented Feb 1, 2025

I'm hopeful that the update to fetch v3 comparability will fix this

It won't. The tests won't timeout anymore, but the expected errors will be null.

@cjihrig
Copy link
Contributor

cjihrig commented Feb 1, 2025

I created a reduced reproduction of the issue to share with the nock team:

import assert from 'node:assert';
import { createInterface } from 'node:readline';
import { PassThrough } from 'node:stream';
import fetch from 'node-fetch';
import nock from 'nock';

const stream = new PassThrough();
const expectedErr = new Error('boom!');
let response;

const scope = nock('http://foo.com');
const s = scope
  .get('/bar')
  .reply(200, function() {
    this.req.on('response', (r) => {
      response = r;
    });
    stream.push(JSON.stringify({ name: 'obj1' }) + '\n');
    stream.push(JSON.stringify({ name: 'obj2' }) + '\n');
    return stream;
  });

const res = await fetch('http://foo.com/bar');
assert.strictEqual(res.status, 200);

const waitForLines = Promise.withResolvers();
const waitForError = Promise.withResolvers();
const lines = [];
let actual;

const readline = createInterface(res.body);

readline.on('error', (err) => {
  actual = err;
  waitForError.resolve();
});

readline.on('line', (line) => {
  lines.push(line);
  if (lines.length === 2) {
    waitForLines.resolve();
  }
});

await waitForLines.promise;
assert.deepStrictEqual(lines, [
  JSON.stringify({ name: 'obj1' }),
  JSON.stringify({ name: 'obj2' }),
]);

response.destroy(expectedErr);
await waitForError.promise;
assert.strictEqual(actual, expectedErr);
console.log('done!');

I tested this with Node 23.7.0 and [email protected], which are both the latest at the time of writing.

With [email protected] and [email protected] (latest 13x release), this completes successfully. With [email protected] (where I believe the break was introduced) and [email protected], this does not complete successfully because the 'error' event is no longer emitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants