Skip to content

Conversation

@kettanaito
Copy link
Member

@kettanaito
Copy link
Member Author

I think the test failures are related to some HTTP requests being bypassed when they shouldn't be. Perhaps the super.addRequest() actually schedules the request to be performed. I need to look into that and make sure that's only called for passthrough requests if that's the case.

@kettanaito kettanaito changed the title fix: support addRequest from custom http agents fix(ClientRequest): support addRequest from custom http agents Oct 30, 2024
@kettanaito kettanaito marked this pull request as draft October 30, 2024 17:49
@kettanaito
Copy link
Member Author

kettanaito commented Oct 30, 2024

Issue

The flow is this:

  1. addRequest
  2. createSocket
  3. createConnection

If we call this.customAgent.addRequest(), it will likely tap into super.addRequest() of the http.Agent it extends, triggering the actual connection.

I'm trying to patch the http.Agent class so that any custom agents that extend it don't instantiate actual requests by tapping into super. Instead, the actual request will be instantiated in the MockHttpAgent in individual request's context.

@aristofun
Copy link

I'm trying to take it over and can't make browser tests run on Macos.
Do you have by any chance any onboarding docs how to work with this repo?

@aristofun
Copy link

Browser tests and couple of node ones all fail after clean main install :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants