Skip to content

test: update test suite#401

Open
giovtorres wants to merge 2 commits intomainfrom
update-tests
Open

test: update test suite#401
giovtorres wants to merge 2 commits intomainfrom
update-tests

Conversation

@giovtorres
Copy link
Member

This change gets the test suite working again on pull request. It starts with just python3.12. The tests now poll instead of sleeping for 3 seconds between some assertions. I also attempted to address some flaky tests that would only sporadically fail when a race condition was met.

I also updated the test suite to use an updated slurm container that has newer versions of slurm installed in a single container.

@giovtorres giovtorres self-assigned this Mar 10, 2026
@giovtorres giovtorres marked this pull request as ready for review March 10, 2026 23:45
@giovtorres giovtorres requested a review from tazend March 10, 2026 23:45
@tazend
Copy link
Member

tazend commented Mar 11, 2026

Hi Giovanni,

thank you :) I will check it out, but it looks already good - instead of waiting for a hardcoded amount of seconds, it makes more sense to poll whether the correct state of the job is already there or not, so that definitely makes more snese :)

docker exec "$CONTAINER_NAME" bash -c "
cd /pyslurm
rm -rf build/ *.egg-info
find pyslurm -name '*.so' -delete
Copy link
Member

Choose a reason for hiding this comment

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

The setup.py script pretty much already removes all the *.c and *.so files on every run automatically to get a clean build. In the past I had some suprising effects when not cleaning these files and let Cython decide to only rebuild those that were required to recompile. But many of the files are so interleaved now that almost a full rebuild is necessary anyway when something changes I think :)

source $VENV_PATH/bin/activate
pip install -q --disable-pip-version-check -r /pyslurm/test_requirements.txt
cd /pyslurm
pip install -v --disable-pip-version-check -e . --no-build-isolation --config-settings='--build-option=build_ext -j$BUILD_JOBS'
Copy link
Member

Choose a reason for hiding this comment

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

This would also be covered via the scripts/build.sh script. It additionally sets an environment variable called PYSLURM_BUILD_JOBS that is used in setup.py to run the cythonize command with multiple threads. This is iirc separate from the parallelism achieved via the -j flag to build_ext, which only covers compilation afterwards, but not the cythonize step.

I think I would therefore prefer leveraring the existing build.sh script for any installations. We can of course extend the script with further options that are required but not covered yet - but then we have it in a central place.

assert job.steps.get("batch")


def test_load_stats(submit_job):
Copy link
Member

Choose a reason for hiding this comment

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

Did this test_load_stats test fail in your testing? At least in my recent testings it was always working.
If it didn't work we can reintroduce it later, so it shouldn't be a blocker here, but its definitely needed :)

@tazend
Copy link
Member

tazend commented Mar 11, 2026

Also, thank you for completing some tests that were still having a TODO :)

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.

2 participants