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

feature: Use S2N_FAST_INTEG_TESTS to run pytest in parallel under nix #4368

Merged
merged 5 commits into from
Jan 24, 2024

Conversation

dougch
Copy link
Contributor

@dougch dougch commented Jan 17, 2024

Resolved issues:

#2469

Description of changes:

While we don't have a root-cause, there is anecdata that nix (newer toolchain) has a better record of running more than 2 integration test runners in parallel. The original PR for nix contained a CMAKE flag to enable this, but it was removed.

This PR adds it back in and turns on S2N_FAST_INTEG_TESTS by default, which currently only affects nix. The regular integration jobs are built with Make/tox and are pinned at 2 workers

Example use with it enabled by default (basically how CI works now):

nix develop
clean; configure; build; integ sni

Falling back to 1 xdist worker in nix:

nix develop
clean
S2N_CMAKE_OPTIONS="-DS2N_FAST_INTEG_TESTS=OFF" configure
build
integ sni

With "auto" as the pytest xdist runner count, the current batch of integration tests finish in 64 minutes vs. 2 hours with 4 workers sample - both only having 2 "waves".

Call-outs:

The CMake section updated is specifically for Nix.
Not all of the current integration tests run successfully under nix.
Using a default xdist value of 1 could take upwards of 6 hours to finish an integration test run.

Testing:

How is this change tested (unit tests, fuzz tests, etc.)? Locally and ad-hoc CodeBuild. CI run just verifies that no Makefile based integ tests are broken.

Is this a refactor change? no

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Jan 17, 2024
@dougch dougch added the type/nix related to nix label Jan 17, 2024
@dougch dougch marked this pull request as ready for review January 18, 2024 18:53
@@ -551,6 +551,10 @@ if (BUILD_TESTING)
if (S2N_INTEG_TESTS)
find_package (Python3 COMPONENTS Interpreter Development)
file(GLOB integv2_test_files "${PROJECT_SOURCE_DIR}/tests/integrationv2/test_*.py")
set(N 1)
if (S2N_FAST_INTEG_TESTS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this behind a environment variable? Shouldn't it be on by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a CMAKE flag that's off by default on https://github.com/aws/s2n-tls/blob/main/CMakeLists.txt#L35 ; since the non-nix integration tests are run with Make, we could flip it to ON, but I'm trying to not to change the behavior too much. Either way, it might be worth adding an else case here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd still like it to be on by default. Since having it off by default just makes it more difficult for people to select the right thing. But at least having it as an option is better than not having it as an option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flipped to on by default.

@@ -551,6 +551,10 @@ if (BUILD_TESTING)
if (S2N_INTEG_TESTS)
find_package (Python3 COMPONENTS Interpreter Development)
file(GLOB integv2_test_files "${PROJECT_SOURCE_DIR}/tests/integrationv2/test_*.py")
set(N 1)
if (S2N_FAST_INTEG_TESTS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd still like it to be on by default. Since having it off by default just makes it more difficult for people to select the right thing. But at least having it as an option is better than not having it as an option.

@dougch dougch enabled auto-merge (squash) January 24, 2024 01:06
@dougch dougch merged commit d9b0e6d into aws:main Jan 24, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s2n-core team type/nix related to nix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants