mantidproject / mantidimaging

Graphical toolkit for neutron imaging.
https://mantidproject.github.io/mantidimaging
GNU General Public License v3.0
13 stars 6 forks source link

Fix test test_replace_image_stack #2334

Closed samtygier-stfc closed 1 week ago

samtygier-stfc commented 1 week ago

Issue

Closes #2333

Description

The issue was caused by not waiting for the new stack to finish loading. The delay was usually long enough but not always. When it was too slow, then _add_images_to_existing_dataset() would run after the dataset had been deleted in the tearDown. This caused an error dialog which then confused the _click_messageBox() leading to a misleading error message.

This resolves the issue by doing a proper wait_until(), so that the test does not proceed until the stack is replaced.

Also add a check for any left open QMessageBox or QDialog, so that this would be caught sooner, or get a better error.

Testing

This fixes the tests

Acceptance Criteria

Tests should all pass

Documentation

Not needed, small fix up to #2317

coveralls commented 1 week ago

Coverage Status

coverage: 74.337%. remained the same when pulling 0243d63806e44bf3c7c857e874e8893726647b75 on 2333-fix-test-replace into 1d27e8484982f75d5722546485a21d015ab8238a on main.