Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parallel execution of DICOM tests #1182

Merged
merged 5 commits into from
Jan 18, 2024

Conversation

jcfr
Copy link
Member

@jcfr jcfr commented Jan 17, 2024

  • Update ctkDICOMDatabaseTest2 to test use of lower and upper case tags
  • Fix argument processing and usage message in ctkDICOM tests
  • Support running tests using dcmqrscp in parallel
  • Ensure DICOM tests all read/write from different sqlite database
  • Update ctkDICOMTester to always kill "storescp" process on destruction

… tags

Follow-up of 73ab63a ("BUG: Fix ctkDICOMDatabaseTest2 comparing upper-cased
tag", 2024-01-12)
@jcfr jcfr force-pushed the fix-parallel-execution-of-dicom-tests branch from 9bb474b to 72778f1 Compare January 18, 2024 06:01
jcfr and others added 3 commits January 18, 2024 01:42
The CTest driver automatically updates the first argument to match
the test name. This commit ensures that only one argument is removed
from the list before retrieving test-specific arguments, if any.

Switch all DICOM tests to process arguments using the list returned
by `QCoreApplication::arguments()`.

Additionally, it updates the use of the command line parser
in `ctkFileDialogTest1`.

Co-authored-by: Davide Punzo <[email protected]>
This will prevent the following test from all running in parallel with
a `dcmqrscp` executable configured to listen on the same port.

Tests either using "dcmqrscp" executable directly or through the
`ctkDICOMTester` helper class:

* ctkDICOMApplicationTest1
* ctkDICOMQueryTest2
* ctkDICOMRetrieveTest2
* ctkDICOMTesterTest1
* ctkDICOMTesterTest2
@jcfr jcfr force-pushed the fix-parallel-execution-of-dicom-tests branch from 72778f1 to d49a7a9 Compare January 18, 2024 06:42
…uction

Since the DCMTK executable do not seem to configure a termination handler on
windows (using `SetConsoleCtrlHandler()`) or on Unix (using `sigaction()`),
we speed up testing by simply killing the process.

> On Windows, terminate() posts a WM_CLOSE message to all top-level
> windows of the process and then to the main thread of the process
> itself. On Unix and macOS the SIGTERM signal is sent.
>
> Console applications on Windows that do not run an event loop, or whose
> event loop does not handle the WM_CLOSE message, can only be terminated
> by calling kill().

Source: https://doc.qt.io/qt-5/qprocess.html#terminate
@jcfr jcfr enabled auto-merge (rebase) January 18, 2024 07:13
@jcfr jcfr merged commit 5b502aa into commontk:master Jan 18, 2024
4 checks passed
@jcfr jcfr deleted the fix-parallel-execution-of-dicom-tests branch January 18, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant