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

Fence off Network IO with NO_NETWORK_TESTING #561

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

Conversation

kentfredric
Copy link

This is a workaround for #477 but doesn't actually fix the underlying
issue, merely recognises that some vendors are smart enough to
anticipate Network IO will fail and integrate this ENV var to quickly
avoid it.

This precedent was established by Test::RequiresInternet as a result of
a CPANworkers discussion, and Gentoo is known to export this variable
within its tooling by default as a result.

This doesn't actually test that binding a socket/IP will work, but this
fence should be tested anyway, because security measures could result in
attempted socket/IP binds getting SIGKILLed ( Sandbox )

This commit hence addresses/fences only the problem cases listed in bug
in depth.

However, this commit targets to simply solve the known parts of the
problem in the simplest way possible without any extra dependencies.

The application of a BEGIN { } block and print was a design decision
instead of using Test::More and skip, because the overhead of
loading Test::More is quite high when you have lots of .t files, and
Test2 further increases the load time.

This load time is generally acceptable if you're actually running a
dozen tests, but spinning up a full suite of Test::More to only then
immediately exit with a skip is a lot of CPU load for relatively little
benefit.

This is a workaround for plack#477 but doesn't actually fix the underlying
issue, merely recognises that some vendors are smart enough to
anticipate Network IO will fail and integrate this ENV var to quickly
avoid it.

This precedent was established by Test::RequiresInternet as a result of
a CPANworkers discussion, and Gentoo is known to export this variable
within its tooling by default as a result.

This doesn't actually test that binding a socket/IP will work, but this
fence should be tested anyway, because security measures could result in
attempted socket/IP binds getting SIGKILLed ( Sandbox )

This commit hence addresses/fences only the problem cases listed in bug
in depth.

However, this commit targets to simply solve the known parts of the
problem in the simplest way possible without any extra dependencies.

The application of a BEGIN { } block and `print` was a design decision
instead of using `Test::More` and `skip`, because the overhead of
loading Test::More is quite high when you have lots of .t files, and
Test2 further increases the load time.

This load time is generally acceptable if you're actually running a
dozen tests, but spinning up a full suite of Test::More to only then
immediately exit with a skip is a lot of CPU load for relatively little
benefit.
@kentfredric
Copy link
Author

NB: I fully expect this not to be "Ready state" and await discussion on how we should proceed.

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.

1 participant