Skip to content

Commit 4e44213

Browse files
committed
[Tutorials] Fix uhi test timeouts in matplotlib.
On some Mac VMs, matplotlib.show() was entering an interactive event loop, which caused four uhi tutorials to time out. By switching matplotlib to the PNG backend, show() is skipped as follows: hist015_TH1_read_and_draw_uhi.py:88: UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown plt.show()
1 parent 5f26aa6 commit 4e44213

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tutorials/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ else() # testing using an installation
3737
enable_testing()
3838
endif()
3939

40-
# Set the environment for the tutorials, which is the eventual ROOT_environ
40+
# - Set the environment for the tutorials, which is the eventual ROOT_environ
4141
# plus some environment variables related to limiting the number of threads
4242
# used by NumPy.
4343
# See: https://stackoverflow.com/questions/30791550/limit-number-of-threads-in-numpy
44-
set(TUTORIAL_ENV ${ROOT_environ} OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1)
44+
# - For matplotlib, disable a blocking event loop on show() using a non-interactive backend
45+
set(TUTORIAL_ENV ${ROOT_environ} OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 MPLBACKEND=AGG)
4546

4647
#---Copy the CTestCustom.cmake file into the build directory--------
4748
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)

0 commit comments

Comments
 (0)