Improve partitioner unit tests#254
Conversation
james-bruten-mo
left a comment
There was a problem hiding this comment.
rose-stem all good
stevemullerworth
left a comment
There was a problem hiding this comment.
Testing the branch infrastructure unit tests on the command line makes sense, and code looks OK. On merging on main, I get a failure with run_lfric_xios_integration_tests_azspice_gnu_64bit: the job.out looks fine, but the job.err reports an "unexpected error"
MatthewHambley
left a comment
There was a problem hiding this comment.
Presumed build system code owner's review. This looks fine, bumping the number of processes for the mpiexec is not a problem. I've made a drive-by comment on something else for the actual reviewers to consider.
| num_cells_ghost = partition%get_num_cells_ghost() | ||
| @assertEqual( 0, num_cells_ghost ) | ||
|
|
||
| case (3) |
There was a problem hiding this comment.
I appreciate that you're following the existing pattern, but if each of these tests are so different they may, in fact, be three different tests with different number of MPI processes. Rather than one run three times.
There was a problem hiding this comment.
I don't think these tests are really that different. They all call the same list of type-bound functions fr om the partition object, but those functions return different values in each case. It probably could be better "engineered", but this is a unit test, so I don't think it really has to (or even should) be that well "engineered" - a simple linear list of tests and expected results is probably the simplest to understand and maintain.
These tests all work by writing data to the same set of files - so occasionally there is contention within the filing system and we see the failure mentioned above. This PR allows those tests to run in parallel, so it is more likely that writes will happen at the same time, which exacerbates the issue. The answer is to make all the tests run in there own directory - so there will be no write contention. The good news is that @EdHone has already done this work in #212 - which is currently waiting for a code review. The answer, here, is to just wait until #212 makes its way onto main, then merge the branch up to head. I'll pass the PR back into code review when that happens. |
|
PR #212 has been committed to main, so that should fix the intermittent failures due to the race condition in the lfric_xios integration tests once the "Update branch" button has been clicked. No other changes to this branch should be required. I am, therefore, passing this back to the reviewer for another test (and hopefully commit). |
stevemullerworth
left a comment
There was a problem hiding this comment.
Tests previously failed intermittently, but issue resolved by a separate PR.
PR Summary
Sci/Tech Reviewer: None required
Code Reviewer: @stevemullerworth
I noted three deficiencies with the partition unit tests:
Code Quality Checklist
Testing
Test Suite Results - lfric_core - partition_test/run1
Suite Information
Task Information
✅ succeeded tasks - 372
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
PSyclone Approval
Code Review