# Fixing extension testing failures

**URL:** <https://discourse.slicer.org/t/fixing-extension-testing-failures/32584>\
**Category:** Development\
**Tags:** testing\
**Created:** [November 3, 2023, 3:11pm UTC](https://discourse.slicer.org/t/fixing-extension-testing-failures/32584 "2023-11-03T15:11:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhlegarreta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jhlegarreta/32/66542_2.png) [@jhlegarreta](https://discourse.slicer.org/u/jhlegarreta)\
**Post date:** [November 3, 2023, 3:11pm UTC](https://discourse.slicer.org/t/fixing-extension-testing-failures/32584/1 "2023-11-03T15:11:38Z")

</div>

Hi,  
there are a number of tests in the `SlicerDMRI` extension build that I would like to fix:  
[CDash](https://slicer.cdash.org/viewTest.php?onlyfailed&buildid=3198672)

Some of them (e.g. [py\_TractographyExportPLY](https://slicer.cdash.org/test/25944478), [py\_TractographyDownsample](https://slicer.cdash.org/test/25944480)) report a short message saying

```auto
[/Users/svc-dashboard/D/S/A/Slicer-build/bin/Slicer.app/Contents/MacOS/./Slicer] exit abnormally - Report the problem.

```

I’ve found these potentially related threads, and have read the information in the corresponding links:  
[PythonSlicer problem with vtk and ReadData · Issue #6484 · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/issues/6484)  
[Extension tests fail on CDash, why? - #13 by RafaelPalomar](https://discourse.slicer.org/t/extension-tests-fail-on-cdash-why/26571/13)

However, it is unclear what the appopriate sorting for the imports is: is this documented somewhere? Otherwise, what is the recipe? I have tried a few different sortings without success for e.g.:  
[https://github.com/SlicerDMRI/SlicerDMRI/blob/372675b96e917acb61bc8cb2ac9262d87cc5b06a/Modules/Scripted/TractographyExportPLY/TractographyExportPLY.py#L6](https://github.com/SlicerDMRI/SlicerDMRI/blob/372675b96e917acb61bc8cb2ac9262d87cc5b06a/Modules/Scripted/TractographyExportPLY/TractographyExportPLY.py#L6)  
[https://github.com/SlicerDMRI/SlicerDMRI/blob/372675b96e917acb61bc8cb2ac9262d87cc5b06a/Modules/Scripted/TractographyDownsample/TractographyDownsample.py#L9](https://github.com/SlicerDMRI/SlicerDMRI/blob/372675b96e917acb61bc8cb2ac9262d87cc5b06a/Modules/Scripted/TractographyDownsample/TractographyDownsample.py#L9)

Also, there are a number of tests (e.g. [py\_fiber\_visibility\_crash2438](https://slicer.cdash.org/test/25944472)) that fail because data nodes are not available in the scene, e.g.

```auto
 tractNode = slicer.util.getNode('tract1')
 (...)
 slicer.util.MRMLNodeNotFoundException: could not find nodes in the scene by name or id 'tract1'

```

I’ve seen that the data does not get loaded into the scene (it does if I use a `ModelFile` type, but then fails to get other fiber data type-specific properties):  
[https://github.com/SlicerDMRI/SlicerDMRI/blob/372675b96e917acb61bc8cb2ac9262d87cc5b06a/Modules/Loadable/TractographyDisplay/Testing/Python/fiber\_visibility\_crash2438.py#L191](https://github.com/SlicerDMRI/SlicerDMRI/blob/372675b96e917acb61bc8cb2ac9262d87cc5b06a/Modules/Loadable/TractographyDisplay/Testing/Python/fiber_visibility_crash2438.py#L191)

The command looks correct, though. What am I missing here? How can this be tested properly/fixed?

Note that the data was moved (related topic [Actual data content of slicer.kitware.com-midas3-archive](https://discourse.slicer.org/t/actual-data-content-of-slicer-kitware-com-midas3-archive/30921)) and the correct `uris` for the data would be [https://github.com/Slicer/slicer.kitware.com-midas3-archive/releases/download/SHA256/06d5b5777915857fbac7b3cbd9c371523d1371f29b0c89eb7a33d86d780d5b2b](https://github.com/Slicer/slicer.kitware.com-midas3-archive/releases/download/SHA256/06d5b5777915857fbac7b3cbd9c371523d1371f29b0c89eb7a33d86d780d5b2b).

Thanks.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [November 3, 2023, 8:50pm UTC](https://discourse.slicer.org/t/fixing-extension-testing-failures/32584/2 "2023-11-03T20:50:53Z")

</div>

Are you able to replicate the test crashes in a local debug build?

Regarding the import order difference maybe you can join one the Tuesday morning developer meeting and we can discuss. It should just be a matter of following the class hierarchy and library dependencies.

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jhlegarreta/32/66542_2.png) [@jhlegarreta](https://discourse.slicer.org/u/jhlegarreta)\
**Post date:** [November 6, 2023, 12:10am UTC](https://discourse.slicer.org/t/fixing-extension-testing-failures/32584/3 "2023-11-06T00:10:11Z")

</div>

Thanks for answering Steve.

> [@pieper](#):
>
> Are you able to replicate the test crashes in a local debug build?

Have not tried debugging; I am able to reproduce the issue from a command line run. Have read the debugging instructions in the Slicer documentation, but it is unclear to me how this can be debugged (this being an extension, this being a Python module, etc.).

> [@pieper](#):
>
> Regarding the import order difference maybe you can join one the Tuesday morning developer meeting and we can discuss. It should just be a matter of following the class hierarchy and library dependencies.

Have a meeting 11:00-12:00 ET. If it does not conflict, I may join.
