equinor / xtgeo

XTGeo Python class library for subsurface Surfaces, Cubes, Wells, Grids, Points, etc
https://xtgeo.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
109 stars 57 forks source link

matplotlib causing xdist worker crashes on macOS CI #1105

Closed mferrera closed 10 months ago

mferrera commented 10 months ago

With --generate-plots enabled there seem to be random crashes on macOS.

In tests/test_surface/test_regular_surface_vs_grd3d.py::test_surface_from_grd3d_layer, the following line causes the following stack trace

surf.quickplot(filename=join(tmpdir, "surf_from_grid3d_top.png"))
Fatal Python error: Aborted
tests/test_surface/test_regular_surface_vs_grd3d.py::test_surface_from_grd3d_layer 

[gw3] node down: Not properly terminated
Current thread 0x000070000bc02000 (most recent call first):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backends/backend_macosx.py", line 154 in __init__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backend_bases.py", line 2686 in create_with_canvas
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backend_bases.py", line 1785 in new_manager
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backend_bases.py", line 3407 in new_figure_manager_given_figure
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/backend_bases.py", line 3402 in new_figure_manager
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/pyplot.py", line 465 in new_figure_manager
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/pyplot.py", line 934 in figure
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/matplotlib/pyplot.py", line 1598 in subplots
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/xtgeoviz/plot/baseplot.py", line 192 in canvas
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/xtgeo/surface/regular_surface.py", line 3054 in quickplot
  File "/Users/runner/work/xtgeo/xtgeo/tests/test_surface/test_regular_surface_vs_grd3d.py", line 98 in test_surface_from_grd3d_layer
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/python.py", line 194 in pytest_pyfunc_call
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_callers.py", line 77 in _multicall
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_manager.py", line 115 in _hookexec
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_hooks.py", line 493 in __call__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/python.py", line 1792 in runtest
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/runner.py", line 169 in pytest_runtest_call
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_callers.py", line 77 in _multicall
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_manager.py", line 115 in _hookexec
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_hooks.py", line 493 in __call__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/runner.py", line 262 in <lambda>
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/runner.py", line 341 in from_call
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/runner.py", line 261 in call_runtest_hook
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/runner.py", line 222 in call_and_report
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/runner.py", line 133 in runtestprotocol
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/runner.py", line 114 in pytest_runtest_protocol
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_callers.py", line 77 in _multicall
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_manager.py", line 115 in _hookexec
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_hooks.py", line 493 in __call__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/xdist/remote.py", line 174 in run_one_test
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/xdist/remote.py", line 157 in pytest_runtestloop
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_callers.py", line 77 in _multicall
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_manager.py", line 115 in _hookexec
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_hooks.py", line 493 in __call__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/main.py", line 325 in _main
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/main.py", line 271 in wrap_session
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/_pytest/main.py", line 318 in pytest_cmdline_main

  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_callers.py", line 77 in _multicall
replacing crashed worker gw3
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_manager.py", line 115 in _hookexec
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pluggy/_hooks.py", line 493 in __call__
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/xdist/remote.py", line 355 in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/execnet/gateway_base.py", line 1157 in executetask
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/execnet/gateway_base.py", line 296 in run
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/execnet/gateway_base.py", line 361 in _perform_spawn

Thread 0x000070000abff000 (most recent call first):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/execnet/gateway_base.py", line 474 in read
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/execnet/gateway_base.py", line 507 in from_io
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/execnet/gateway_base.py", line 1049 in _thread_receiver
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/execnet/gateway_base.py", line 296 in run
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/execnet/gateway_base.py", line 361 in _perform_spawn

Thread 0x0000000112592600 (most recent call first):
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py", line 334 in wait
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/threading.py", line 634 in wait
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/execnet/gateway_base.py", line 339 in integrate_as_primary_thread
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/execnet/gateway_base.py", line 1142 in serve
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/execnet/gateway_base.py", line 1640 in serve
  File "<string>", line 8 in <module>
  File "<string>", line 1 in <module>

Extension modules: numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, pandas._libs.tslibs.np_datetime, pandas._libs.tslibs.dtypes, pandas._libs.tslibs.base, pandas._libs.tslibs.nattype, pandas._libs.tslibs.timezones, pandas._libs.tslibs.ccalendar, pandas._libs.tslibs.fields, pandas._libs.tslibs.timedeltas, pandas._libs.tslibs.tzconversion, pandas._libs.tslibs.timestamps, pandas._libs.properties, pandas._libs.tslibs.offsets, pandas._libs.tslibs.strptime, pandas._libs.tslibs.parsing, pandas._libs.tslibs.conversion, pandas._libs.tslibs.period, pandas._libs.tslibs.vectorized, pandas._libs.ops_dispatch, pandas._libs.missing, pandas._libs.hashtable, pandas._libs.algos, pandas._libs.interval, pandas._libs.lib, pandas._libs.ops, pandas._libs.arrays, pandas._libs.tslib, pandas._libs.sparse, pandas._libs.indexing, pandas._libs.index, pandas._libs.internals, pandas._libs.join, pandas._libs.writers, pandas._libs.window.aggregations, pandas._libs.window.indexers, pandas._libs.reshape, pandas._libs.groupby, pandas._libs.json, pandas._libs.parsers, pandas._libs.testing, xtgeo._cxtgeo, h5py._errors, h5py.defs, h5py._objects, h5py.h5, h5py.utils, h5py.h5t, h5py.h5s, h5py.h5ac, h5py.h5p, h5py.h5r, h5py._proxy, h5py._conv, h5py.h5z, h5py.h5a, h5py.h5d, h5py.h5ds, h5py.h5g, h5py.h5i, h5py.h5f, h5py.h5fd, h5py.h5pl, h5py.h5o, h5py.h5l, h5py._selector, shapely.lib, shapely._geos, shapely._geometry_helpers, scipy._lib._ccallback_c, scipy.special._ufuncs_cxx, scipy.special._ufuncs, scipy.special._specfun, scipy.special._comb, scipy.linalg._fblas, scipy.linalg._flapack, scipy.linalg.cython_lapack, scipy.linalg._cythonized_array_utils, scipy.linalg._solve_toeplitz, scipy.linalg._decomp_lu_cython, scipy.linalg._matfuncs_sqrtm_triu, scipy.linalg.cython_blas, scipy.linalg._matfuncs_expm, scipy.linalg._decomp_update, scipy.sparse._sparsetools, _csparsetools, scipy.sparse._csparsetools, scipy.sparse.linalg._isolve._iterative, scipy.sparse.linalg._dsolve._superlu, scipy.sparse.linalg._eigen.arpack._arpack, scipy.sparse.csgraph._tools, scipy.sparse.csgraph._shortest_path, scipy.sparse.csgraph._traversal, scipy.sparse.csgraph._min_spanning_tree, scipy.sparse.csgraph._flow, scipy.sparse.csgraph._matching, scipy.sparse.csgraph._reordering, scipy.linalg._flinalg, scipy.special._ellip_harm_2, scipy.interpolate._fitpack, scipy.interpolate.dfitpack, scipy.optimize._minpack2, scipy.optimize._group_columns, scipy._lib.messagestream, scipy.optimize._trlib._trlib, scipy.optimize._lbfgsb, _moduleTNC, scipy.optimize._moduleTNC, scipy.optimize._cobyla, scipy.optimize._slsqp, scipy.optimize._minpack, scipy.optimize._lsq.givens_elimination, scipy.optimize._zeros, scipy.optimize.__nnls, scipy.optimize._highs.cython.src._highs_wrapper, scipy.optimize._highs._highs_wrapper, scipy.optimize._highs.cython.src._highs_constants, scipy.optimize._highs._highs_constants, scipy.linalg._interpolative, scipy.optimize._bglu_dense, scipy.optimize._lsap, scipy.spatial._ckdtree, scipy.spatial._qhull, scipy.spatial._voronoi, scipy.spatial._distance_wrap, scipy.spatial._hausdorff, scipy.spatial.transform._rotation, scipy.optimize._direct, scipy.interpolate._bspl, scipy.interpolate._ppoly, scipy.interpolate.interpnd, scipy.interpolate._rbfinterp_pythran, scipy.interpolate._rgi_cython, scipy.ndimage._nd_image, _ni_label, scipy.ndimage._ni_label, matplotlib._c_internal_utils, PIL._imaging, matplotlib._path, kiwisolver._cext, yaml._yaml, matplotlib._image, matplotlib.backends._macosx (total: 154)

[gw3] [ 64%] FAILED tests/test_surface/test_regular_surface_vs_grd3d.py::test_surface_from_grd3d_layer