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.
coverage: 74.337%. remained the same
when pulling 0243d63806e44bf3c7c857e874e8893726647b75 on 2333-fix-test-replace
into 1d27e8484982f75d5722546485a21d015ab8238a on main.
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 thetearDown
. 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
orQDialog
, 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