You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Investigate the CI jobs and testing strategy and propose 3 alternatives modification/fixes.
Specify pros and cons for each alternatives, document all of them on this issue before implementing anything.
I have investigated the CI jobs taking 1+ hours. The main bottleneck is the PyTest execution itself (which takes ~42 minutes), exacerbated by run_test_container.sh running both HTTP and non-HTTP test suites in parallel on the same runner, causing massive CPU/IO contention.
Here are 3 alternative modifications/fixes to reduce CI time:
Alternative 1: Parallelize tests using pytest-xdist
Use the pytest-xdist plugin to run tests in parallel across multiple CPU cores within the same container (pytest -n auto).
Pros: Drastically reduces test execution time by fully utilizing the runner's CPU. No need to modify the GitHub Actions workflow structure or provision additional runners.
Cons: Tests must be completely independent. Since tests run against the same ApertureDB instance, parallel tests might clash if they modify shared state (e.g., clearing the DB, adding/removing the same schema). This may require significant refactoring of the test suite for isolation.
Alternative 2: Split HTTP and non-HTTP tests into a GitHub Actions Matrix
Currently, run_test_container.sh runs both HTTP and non-HTTP tests simultaneously in the background on the same runner. We can split these into a GitHub Actions matrix so they run as completely separate jobs.
Pros: Eliminates resource contention on a single runner. Provides better visibility in the GitHub UI regarding which transport protocol failed.
Cons: Requires having multiple self-hosted runners available concurrently. If only one runner is available, the jobs will queue up sequentially, and the total wall-clock time will actually increase due to the duplicated Docker build/setup overhead.
Alternative 3: Test Sharding (Split test files across multiple jobs)
Divide the test suite into logical chunks/shards (e.g., 3-4 shards) and run them in parallel jobs across multiple runners using a GitHub Actions matrix.
Pros: Can linearly decrease the PyTest execution time. Keeps tests within a shard sequential, avoiding the DB state clashes that pytest-xdist would cause.
Cons: Requires multiple self-hosted runners. It also introduces complexity in balancing the shards, as some test files (like test_Data.py) take significantly longer than others.
Activity
ad-claw000 commentedon Apr 23, 2026
I have investigated the CI jobs taking 1+ hours. The main bottleneck is the PyTest execution itself (which takes ~42 minutes), exacerbated by
run_test_container.shrunning both HTTP and non-HTTP test suites in parallel on the same runner, causing massive CPU/IO contention.Here are 3 alternative modifications/fixes to reduce CI time:
Alternative 1: Parallelize tests using
pytest-xdistUse the
pytest-xdistplugin to run tests in parallel across multiple CPU cores within the same container (pytest -n auto).Alternative 2: Split HTTP and non-HTTP tests into a GitHub Actions Matrix
Currently,
run_test_container.shruns both HTTP and non-HTTP tests simultaneously in the background on the same runner. We can split these into a GitHub Actions matrix so they run as completely separate jobs.Alternative 3: Test Sharding (Split test files across multiple jobs)
Divide the test suite into logical chunks/shards (e.g., 3-4 shards) and run them in parallel jobs across multiple runners using a GitHub Actions matrix.
pytest-xdistwould cause.test_Data.py) take significantly longer than others.ad-claw000 commentedon Apr 23, 2026
This was implemented by #663.