Ticket #7656 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Speed up LoadEventNexus unit test

Reported by: Russell Taylor Owned by: Russell Taylor
Priority: critical Milestone: Release 3.0
Component: Framework Keywords: Maintenance
Cc: Blocked By:
Blocking: #7521 Tester: Peter Peterson

Description

This is one of our slower unit tests, which across the board takes about 10s or longer to run. It is a critical algorithm, so we can probably cut it more slack than some others, and of course it has to touch real files, but it would be good to make it a little quicker.

One step that can certainly be taken is to move the recently added BASIS check to a system test. The other particularly slow method appears to be 'testSimulatedFile'.

Change History

comment:1 Changed 7 years ago by Russell Taylor

  • Status changed from new to inprogress

Re #7656. Add an 'expected' file for our BASIS data file.

This checks the number of events in the first event list (and the second, just for fun) to avoid any regression of the fix for the bug described in ticket #7524.

Changeset: 475e69c4e53ae30848d7feba8d71ebe7ecd17223

comment:2 Changed 7 years ago by Russell Taylor

Re #7656. Remove test of BASIS loading.

This is now covered by the LoadLotsOfFiles system test (via the addition of an 'expected' file to check the number of events in the first event list).

Changeset: 83af8ad7673dfc9610af1d1dd708f07a644154c1

comment:3 Changed 7 years ago by Russell Taylor

Re #7656. Try to make the slowest test method faster.

By only loading one bank.

Changeset: f06151107f74f0b38a016d62093eca875c8d7c5a

comment:4 Changed 7 years ago by Russell Taylor

Re #7656. Add test of filtered loading vs loading then filtering.

This replaces a (slow) unit test that was supposed to test the same thing.

Changeset: fb0156bdb46338f6eccc4ea4405526b65e3522f9

comment:5 Changed 7 years ago by Russell Taylor

Re #7656. Remove test that's been replaced by a system test.

Note that this test wasn't testing what it purported to because lines 235 & 280 were identical! When this error was fixed the test failed (the reason for which has been addressed in the new system test).

Changeset: 58e03ebf9855ce21de2a99b34b585b1cddd71aaf

comment:6 Changed 7 years ago by Russell Taylor

Re #7656. Consolidate some of the test methods.

This means that the algorithm is run fewer times, but the same things are still tested. Also don't load the logs where possible.

Changeset: e0ebecabbb56c78ac8895fe912a0a5a38c25e31d

comment:7 Changed 7 years ago by Russell Taylor

Re #7656. Fix copy-paste error.

Changeset: 990901ca0ffd79f9dc6522b6df9cc52e468bc66f

comment:8 Changed 7 years ago by Russell Taylor

  • Status changed from inprogress to verify
  • Resolution set to fixed

Tester: NOTE THAT THERE ARE BRANCHES FOR THIS IN BOTH THE MAIN AND THE SYSTEMTESTS REPOSITORIES FOR THIS!!! Both are called feature/7656_speed_up_loadeventnexustest.

The test suite is something like 30% faster now. It's still quite slow but then this is one of our most important algorithms. Unfortunately, the slowest test method (testSimulatedFile) is very much a corner case, but I don't think I can make it any faster (I think most of the time is in loading the instrument).

You can check the speed up in a (develop branch) Jenkins job, or with a local build, but the more important thing to check is that I haven't lessened the overall test coverage with these changes.

comment:9 Changed 7 years ago by Peter Peterson

  • Status changed from verify to verifying
  • Tester set to Peter Peterson

comment:10 Changed 7 years ago by Peter Peterson

  • Status changed from verifying to closed

I made sure things run then looked more closely at the integrated differences. One of the longer running tests got moved to be a system test, and the rest was modified (mostly) just to load less.

comment:11 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8501

Note: See TracTickets for help on using tickets.