-
-
Notifications
You must be signed in to change notification settings - Fork 424
CDMS: Fix off-by-one error, make tests smoother #3298
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
Conversation
|
omg... what happened to that commit message? I'm going to clean that up. |
…r this time. Now just guesswork though....'! I didn't check the AI autocomplete... how did it come up with 3300?)
parametrize test over full list of molecules
|
fwiw, I use Tom's script to see what the next number is, without the need of opening up the browser: https://github.com/astropy/astropy-tools/blob/main/next_pr_number.py |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3298 +/- ##
=======================================
Coverage 69.47% 69.47%
=======================================
Files 232 232
Lines 19707 19707
=======================================
Hits 13691 13691
Misses 6016 6016 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This is ready from my side. lmk if you want another changelog entry (besides fixing the last one...) |
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.
Tests runtime doubles, so that should ideally be looked into before this can be merged.
| for row in species_table: | ||
|
|
||
| @pytest.mark.parametrize('row', species_table) | ||
| def test_regression_allcats(self, row): |
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.
Now there are two failures, and the overall test runtime is double.
FAILED astroquery/linelists/cdms/tests/test_cdms_remote.py::TestRegressionAllCats::test_regression_allcats[row1135] - requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
FAILED astroquery/linelists/cdms/tests/test_cdms_remote.py::TestRegressionAllCats::test_regression_allcats[row1268] - requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
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.
Those are (probably) intermittent errors, and the runtime doubling is likely server side variation: the test is identical to what it was before, it just does more reporting now. Admittedly, that could be pytest overhead, but I suspect not.
(also there are 6 more entries than previously, but it's unlikely that 6 / 1306 doubles the time)
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 test is marked big_data and should be skipped normally, but it's really useful to be able to run occasionally to check if they've added a new molecule that fills a new corner case we hadn't handled before (as happened with 100501)
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'm OK with keeping the test in even it's slow (locally running I don't skip the bigdata ones), but this PR makes them being 15min long instead of 7. I'm pretty sure that's not pytest overhead.
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.
Are you saying that this test accounts for 50% of the total astroquery test time? Or that the change in this PR specifically has increased the test time by 2x?
If the latter... I don't understand what could cause that, it's just changing from a for loop to a parameterization over the same list. I greatly prefer this version, since it gives a useful progressbar and a more useful message if it breaks.
My guess is still that it's time-of-day/server-load dependent, since the test is doing ~1300 independent queries (before & after this PR)
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, I ran the tests locally without failure, so that points to the failures above being intermittent/one-time things
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.
It's this module's timing up from 7 to 15 mins from main to this PR.
(Total time for remote tests is in the ~1.5-2 hours including the reruns, so it's not a critical deal within the big picture, but I would like to understand why this refactoring doubles the runtime).
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.
OK, yeah, that's really weird. I wonder if one of the new molecules has an absolutely gigantic file... does pytest do per-test timing? I'll check
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'll DM you on slack :)
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.
OK, I think I see what's the issue now, this PR should be ok.
(I see much shorter times with the previous layout as I run into a connectionError, thus a lot of molecules are not run. With the new layout if a molecule fails the next one is still being picked up rather than the whole thing bailing on the remaining of the loop)
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.
Thanks! This in fact now fixes that we always run all the molecules
Followup to #3296 & #3297.