-
Notifications
You must be signed in to change notification settings - Fork 119
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
Improve CI run time #2215
base: master
Are you sure you want to change the base?
Improve CI run time #2215
Conversation
9c8e590
to
eb9bba1
Compare
@@ -63,7 +63,6 @@ | |||
"generator": "Ninja", | |||
"environment": { "cmakepreset_expected_host_system": "Windows" }, | |||
"cacheVariables": { | |||
"ARCTICDB_USE_PCH": "ON", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you removed this? Might make @vasil-pashov sad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sccache doesn't work with precompiled headers, so this is making the build much slower on Windows.
AFAIK this is used only in the CI, I am correct @vasil-pashov ?
def get_mongo_client(mongo_uri: str) -> "MongoClient": | ||
from pymongo import MongoClient | ||
|
||
if is_pytest_running(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confused, why can't we just always supply the heartbeat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am greatly reducing the frequency of the heartbeat because we don't really care about it in the testing.
But it is still needed for actual usage of mongo, so better to keep it to the default value.
except botocore.exceptions.ClientError as e: | ||
# There is a problem with xdist on Windows 3.7 | ||
# where we try to clean up the bucket but it's already gone | ||
if e.response["Error"]["Code"] != "NoSuchBucket": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also test that we're on Windows and Python 3.7?
|
||
|
||
@pytest.fixture | ||
def arctic_library_v1(arctic_client_v1, lib_name) -> Library: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also have arctic_library_v2
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we are testing with both v1 and v2 by default.
This new fixture is so we can reduce the number of we can reduce the number of tests which don't really care about the encoding - mainly for the tests that check if we can create library/symbol with a given name.
These tests are quite slow (they have to create/write 100s of libraries/symbols) but are not really affected by the encoding.
If we every need to test only v2, we can add it but this is not needed at the moment.
@@ -1113,11 +1157,14 @@ def test_segment_slicing(arctic_client): | |||
assert num_data_segments == math.ceil(rows / rows_per_segment) * math.ceil(columns / columns_per_segment) | |||
|
|||
|
|||
# skip this test for now | |||
@pytest.mark.skip(reason="There is a strange problem with this one TODO") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't skip this
@@ -59,6 +62,8 @@ def test_write_and_update_large_df_in_chunks(lmdb_version_store_very_big_map): | |||
lib.update(symbol, expected_head) | |||
assert_frame_equal(lib.head(symbol).data, expected_head) | |||
|
|||
|
|||
@pytest.mark.skip(reason="Uses too much storage and fails on GitHub runners") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it presumably does work at the moment? Better to adjust the parameters if needed than skip completely
# WINDOWS, reason="Not enough storage on Windows runners, due to large Win OS footprint and less free mem" | ||
# ) | ||
# @pytest.mark.skipif(MACOS, reason="Problem on MacOs most probably similar to WINDOWS") | ||
@pytest.mark.skip(reason="This test is not conclusive for memory leaks and is very flaky") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is the case I think we should just delete this test @grusev
with pytest.raises(NoDataFoundException) as e: | ||
lib2.read(f"symbol_{x}") | ||
with pytest.raises(NoDataFoundException) as e: | ||
lib2.batch_read(syms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is less comprehensive than the one before (the new check asserts that at least blows up, the old checked they all did)
with pytest.raises(NoDataFoundException) as e: | ||
lib1.read(f"symbol_{x}") | ||
with pytest.raises(NoDataFoundException) as e: | ||
lib1.batch_read(syms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is less comprehensive than the one before (the new check asserts that at least blows up, the old checked they all did)
@@ -71,35 +79,38 @@ def test_stage_finalize_dynamic(arctic_client, lib_name): | |||
|
|||
expected = pd.concat([df1, df2]).sort_values(sort_cols) | |||
pd.testing.assert_frame_equal(result, expected) | |||
arctic_client.delete_library(lib_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup issue?
Try to setup s3 sccache Add SCCACHE environment variables to build workflow Update SCCACHE configuration in build workflow to include region and SSL settings Remove unnecessary GitHub default packages in build workflow to save space Update condition for enabling Windows compiler commands in build workflow Simplify conditions for installing MSVC and enabling Windows compiler commands in build workflow Remove /Zm flags from compiler options and restore PCH usage in CMake presets Remove /Zm flags from CMakeLists and disable PCH usage in CMake presets Clarify SCCACHE_GHA_VERSION environment variable comment in build_steps.yml
…mplemented tests and update library creation logic
…r performance and clarity
…xdist mode configuration
…ngs and error handling; refactor test fixtures for better clarity and performance
…lifying job dependencies; update test scripts to ensure library cleanup after tests
… and error management; streamline MongoDB client initialization during tests
…optimize symbol list test by using batch write for improved performance
…in GitHub Actions workflow
…treamline cleanup and improve test reliability
…xceptions during test teardown
d6db376
to
79df70a
Compare
Reference Issues/PRs
What does this implement or fix?
Builds on top of the PR to improve the build times by using sccache on S3: #2208
This PR improves the test execution by:
These changes improve the total run time of the CI to ~1h (down from ~3h)
Also a couple of very slow tests have been marked as slow to enable faster local testing.
When running all (incl. those that use simulators) of the non-slow tests locally with the following command:
ARCTICDB_RAND_SEED=$RANDOM ARCTICDB_DISABLE_SLOW_TESTS=1 pytest -n auto tests
Runs about 9000 tests in under 10 min (down from ~60 min before).
Which makes the experience of running the tests locally much better.
Any other comments?
Checklist
Checklist for code changes...