Ticket #9896 (inprogress)
Slow Unit Tests for Peter Parker
Reported by: | Owen Arnold | Owned by: | Peter Parker |
---|---|---|---|
Priority: | major | Milestone: | Backlog |
Component: | Framework | Keywords: | Maintenance |
Cc: | Blocked By: | ||
Blocking: | #9905 | Tester: |
Description (last modified by Owen Arnold) (diff)
We have a number of slow running unit tests which we need to fix as part of the 3.3 maintenance window. We are targeting test suits than execute in > 2 seconds on our clean rhel6 build servers. For IO tests (Loading & Saving) we have applied a more generous threshold of > 5 seconds.
See the full list to see which tests have been assigned to you: http://www.mantidproject.org/images/2/2f/Slow_tests.xlsx_-_Sheet1.pdf
Criteria
- Test suits (each test class instance) should execute in < 1 second as a rough target
- As a corollary to the above, If the test suite contains lots of test methods aim for < 0.1 second per test method
- If for some reason you get the speed up the test below the target using the strategies listed below, you need to justify why when you close the ticket.
Guidelines/instructions to help
- Keep tests readable and improve code readability where possible. Unit tests are documentation.
- Do not delete test methods without good reason. We do not want to reduce test coverage
- Changing the algorithm code to improve speed is OK, but exercise caution. Add additional test coverage if it's not already good enough.
- Take test methods that are slow and involve IO, or are processor intensive and make them into system tests. Integration tests are not Unit tests.
- Most of the speed improvements will probably come from better selection of input data. Caching input data is also a good option.
- Create sub tickets for algorithms or groups of algorithms to help testability if you wish, but mark this ticket as the 'blocked' by each one.
Change History
comment:1 Changed 6 years ago by Owen Arnold
- Owner changed from Alex Buts to Peter Parker
- Status changed from new to assigned
- Description modified (diff)
- Summary changed from Slow Unit Tests for Alex Buts (cloned) to Slow Unit Tests for Peter Parker
comment:3 Changed 6 years ago by Peter Parker
Tests of workflow algorithms are by definition integration tests, so ideally it would make sense for all of WorkflowAlgorithmsTest to be moved over to system tests.
In this ticket I'll only address SANSSolidAngleCorrectionTest (the only test over the threshold time of 2 seconds) and SANSBeamFluxCorrectionTest / EQSANSQ2DTest (which are python tests and so are easy to convert).
I've opened #9975 to cover the rest of the C++ tests in the project.
comment:4 Changed 6 years ago by Peter Parker
- Status changed from assigned to inprogress
Refs #9896 - Remove EQSANSQ2DTest as unit test.
Changeset: 5440b930e15354fbb73b0d1aeb747bdfc6ad1bb3
comment:5 Changed 6 years ago by Peter Parker
Refs #9896 - Remove SANSBeamFluxCorrectionTest as unit test.
Changeset: 560fbc3d45d78884ef4d4ca913189fdd98981ff6
comment:6 Changed 6 years ago by Peter Parker
Refs #9896 - Remove SANSSolidAngleCorrectionTest as unit test.
Changeset: f5f30faa6eccfa984a54f50537f36bacd802c603
comment:7 Changed 6 years ago by Peter Parker
Refs #9896 - Reinstate EQSANSQ2D as system test.
Changeset: d09b6a895e19d43647fb5f00c55014974584d8ff
comment:8 Changed 6 years ago by Peter Parker
Refs #9896 - Reinstate SANSBeamFluxCorrectionTest as system test.
Changeset: 3008d469f27d69998208ea53504429f236f20246
comment:9 Changed 6 years ago by Peter Parker
Refs #9896 - Reinstate SANSSolidAngleCorrectionTest as system test.
Changeset: 11fe31d1ce1646568306812a39437df5feb3d90d
comment:10 Changed 6 years ago by Peter Parker
Refs #9896 - Revert past 3 commits.
So that I may find out why an unrelated unit test is now failing as a result of moving these other tests.
Changeset: a2eaf6cee1ff01716eca7dac0076674842c97d03
comment:11 Changed 6 years ago by Nick Draper
Moved to the backlog at the code freeze of R3.3
comment:13 Changed 6 years ago by Peter Parker
Refs #9896 - Reinstate reverted changes.
This reverts commit a2eaf6cee1ff01716eca7dac0076674842c97d03.
Changeset: f787013c35b0037dec6ef2ceea753660a68a9983
comment:14 Changed 6 years ago by Peter Parker
Refs #9896 - Extend linking trick so that StepScanTest may pass.
Changeset: 1a8aa29ac37cdcc8e4733756033ee655030ab032
comment:15 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 10738