actix-web icon indicating copy to clipboard operation
actix-web copied to clipboard

actix-test: allow the configuration of the TestServer address

Open mpalmer opened this issue 1 year ago • 1 comments

PR Type

Feature

PR Checklist

  • [x] Tests for the changes have been added / updated.
  • [x] Documentation comments have been added / updated.
  • [x] A changelog entry has been made for the appropriate packages.
  • [x] Format code with the latest stable rustfmt.
  • [ ] (Team) Label with affected crates and semver status.

Overview

This is useful if you're running (say) Selenium tests against a running TestServer, and the Selenium workers are Docker containers elsewhere in the network. Not a particularly common use case, perhaps, but one that I can attest happens every now and then.

mpalmer avatar May 05 '24 23:05 mpalmer

CI failures appear to be the TlsConnectorService issues that are being addressed in #3350.

mpalmer avatar May 06 '24 01:05 mpalmer

thanks for the addition 👍🏻

looks like it needs a quick look at the new test failure

robjtede avatar Jun 09 '24 02:06 robjtede

Those test failures are weird -- there's no immediately-obvious relationship to my changes. However, since I can't see any recent changes on master that could be to blame, I'll roll up my sleeves and dig in, I guess.

mpalmer avatar Jun 09 '24 07:06 mpalmer

After some rummaging around, I'm fairly confident my changes are at fault, if only because the three failing tests are the ones that are calling actix_test::start, while the other tests are spawning a testing server using other mechanisms. Complicating the problem is that I can't repro the test failures locally, but I'll figure that out one way or another.

mpalmer avatar Jun 09 '24 08:06 mpalmer

Test suite passes now. The problem appears to be that, for some mysterious reason, an IPv6 address in the actix-test-constructed URL is being passed in the resolver library, which proceeds to lose its mind. But only in CI -- it works fine for me locally, even when I hard-code an IPv6 listen address. :shrug:

mpalmer avatar Jun 09 '24 10:06 mpalmer

The CI runners, on their VMs, probably have some crazy IPv6 things going on.

I think the quick fix is to use 127.0.0.1 as the default instead of localhost.

robjtede avatar Jun 09 '24 11:06 robjtede

Ahh I see that's actually what you did. Sorry I was on mobile earlier and didn't check the newest commit.

robjtede avatar Jun 09 '24 19:06 robjtede