-
Notifications
You must be signed in to change notification settings - Fork 192
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
CI: Add matrix testing for both SQLite and PostgreSQL database backends #6670
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6670 +/- ##
==========================================
+ Coverage 77.94% 77.99% +0.06%
==========================================
Files 563 563
Lines 41761 41761
==========================================
+ Hits 32545 32567 +22
+ Misses 9216 9194 -22 ☔ View full report in Codecov by Sentry. |
Also weird that here they only seem to fail for |
6a75315
to
944b030
Compare
I tested with rmq version 3.12 as I had in my localhost. As expected, the failed test has nothing to check with rmq version. |
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.
Thank you @rabbull
In principle I'm in favour of this changes, however now the whole test suite becomes a bit too long.
I understand this might seem inevitable, but I feel like there are many tests that are independent of the type of storage backend. Perhaps they may not need to be repeated two times.
I think it worth to have a quick look in the test folders and mark those tests in a way that they would only run once.
Maybe we can also use @sphuber view on this PR, as probably there's a reason why historically tests are not run for all storage backends.
It is also the symptom I observed in #6659, where I removed |
In #6659, the same failure also occurs with |
I totally agree with you. This PR didn't delve deeper is because it mainly serve for the other two pending PRs, who are blocked by the CI checks, and I believe simply adding |
.github/workflows/ci-code.yml
Outdated
- name: upterm | ||
uses: lhotari/action-upterm@v1 | ||
if: ${{ failure() }} | ||
with: | ||
wait-timeout-minutes: 60 |
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 want to remove this before merge..
@pytest.mark.usefixtures('started_daemon_client') | ||
@pytest.mark.usefixtures('aiida_profile_clean') |
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 can solve the failed test, I think here the problem was caused by the rmq resource racing the queue might be cleaned by the previous test maybe??
When I run only this test in CI, the test will pass. Test only fail when it is run with other tests. I guess it is because the daemon_client is shared and the rmq queue is getting cleaned by other tests (high likely the previous one? it is easy to check by just run the test in this file).
But no matter what the cause is, the solution I think is make the daemon_client independent for this test by using aiida_profile_clean
fixture which will close the daemon (which will call broker_reset
that close the rmq before running the test).
Good point. Then it is not so easy to find out which tests should be tagged with |
At some point, I also saw following exception that might be the root cause of the failed test (I apply the timeout when running test, so maybe the problem of another PR by @rabbull is from this. In remote test stuck, I think the better way is to use
|
You could maybe do this by adding markers automatically based on used fixtures (e.g. Line 75 in 02cbe0c
|
9dc539a
to
acb554d
Compare
CI tests are currently failing due to a known issue. Specifically, with older versions of Since this issue only affects the CI testing procedure, I believe an acceptable solution is:
I will open up a new issue and submit a PR to discuss and address this problem soon. |
Thanks @danielhollas, @rabbull I update the PR, mind to give it look? |
Changes look good, although the fixture fixes seem unrelated to the original purpose of this PR and might be better in a separate one. By the way, just to make things clear, the SQLite backend was already being tested as part of the presto test job. Having an extra SQLite test job will increase the code coverage for SQLite backend by running tests that are not part of presto tests (specifically those that require RMQ). |
The fixture change fix the failed test, see #6670 (comment). I'll try to revert it to see if it is really random (it was always happened when the PR created in the first place by @rabbull). |
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.
Ah, interesting, it looks like the test failure is more reproducible with SQLite backend? Let's just include the fix in this PR then, sorry for the noise.
@danielhollas after I put timeout to single test in #6674, Now, we have two solutions for this,
What do you think? |
I've actually created an issue about moving slow tests to nightly a while ago, see #6526. For now I'd suggest bumping the timeout to 120s and continue the discussion on #6526.
tbh: I am not a huge fan of the timeout. I understand the motivation, but the main downside is that it makes the test suite flaky (as you now encountered). The problem is that GHA runners are very unpredictable and sometimes take much longer to run the tests than usual so it's very hard to pick a timeout value that's both useful (not too large) and not too low to make test suite flaky. |
I didn't see #6526 before, sorry.
Make sense, I'd len to move those to nightly or slow tag tests. Then, if a test runs more than 120s, then it is something we really need to check. |
1f42275
to
d29225c
Compare
Updates the GitHub Actions CI workflows ci-code.yml to include testing for both SQLite and PostgreSQL database backends. This will also increase the testing coverage over SQLite specific codebase.
Thanks @rabbull for the PR and thanks all for reviewing. |
This PR updates the GitHub Actions CI workflows (
ci-code
andtest-install
) to include testing for both SQLite and PostgreSQL database backends. This will also increase the testing coverage over SQLite specific codebase.