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 CI #15

Closed
5 tasks done
kwabenantim opened this issue Jun 20, 2023 · 6 comments · Fixed by #25
Closed
5 tasks done

Fix CI #15

kwabenantim opened this issue Jun 20, 2023 · 6 comments · Fixed by #25
Assignees
Labels
bug Something isn't working

Comments

@kwabenantim
Copy link
Member

kwabenantim commented Jun 20, 2023

Description
Currently, most failing tests are due to #11. After it is fixed, we should:

  • Add GitHub actions to run tests on subsequent PRs.
  • Include a ci:off tag to temporarily skip testing.
  • Fix any remaining tests that are still failing.
    • TestVertexBasedCellSimulationsPythonTutorial
    • TestPetscToolsPython
@kwabenantim kwabenantim added the enhancement New feature or request label Jun 20, 2023
@kwabenantim kwabenantim self-assigned this Jun 20, 2023
@kwabenantim kwabenantim changed the title Add CI testing Add CI Jun 20, 2023
@kwabenantim kwabenantim changed the title Add CI Fix CI Jul 17, 2023
@kwabenantim kwabenantim added bug Something isn't working and removed enhancement New feature or request labels Jul 17, 2023
@kwabenantim
Copy link
Member Author

Failing Tests

  • cell_based/tutorials/TestVertexBasedCellSimulationsPythonTutorial.py
  • core/TestPetscToolsPython.py

@kwabenantim
Copy link
Member Author

kwabenantim commented Jul 17, 2023

TestVertexBasedCellSimulationsPythonTutorial
Runs into a segmentation fault.

Error

[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run 
[0]PETSC ERROR: to get more information on the crash.
[0]PETSC ERROR: Run with -malloc_debug to check if memory corruption is causing the crash.
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 59.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------

Trace

OffLatticeSimulation::Solve(...);
OffLatticeSimulation::ApplyBoundaries(...);
PlaneBoundaryCondition::ImposeBoundaryCondition(...);
if (dynamic_cast<AbstractOffLatticeCellPopulation<ELEMENT_DIM, SPACE_DIM>*>(this->mpCellPopulation) == nullptr){...}

Fix
Resolved itself after switching from C++14 to C++17 and pulling latest updates from Chaste develop branch (fast-forwarded from e1fa6a6 to 3ed690e).

@kwabenantim
Copy link
Member Author

kwabenantim commented Jul 17, 2023

TestPetscToolsPython
Needs wrapping for PETSc Vec and Mat.

Error

======================================================================
ERROR: test_some_vecs (__main__.TestPetscTools)
----------------------------------------------------------------------
TypeError: Unregistered type : _p_Vec

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/vboxuser/PyChaste/test/python/./core/TestPetscToolsPython.py", line 44, in test_some_vecs
    vec = chaste.core.PetscTools.CreateVec(local)
TypeError: Unable to convert function return value to a Python type! The signature was
	(data: List[float]) -> _p_Vec

Maybe Useful
https://gitlab.com/petsc/petsc/-/blob/main/src/binding/petsc4py/src/petsc4py/PETSc.pxd
https://gitlab.com/petsc/petsc/-/blob/main/src/binding/petsc4py/src/petsc4py/PETSc/Mat.pyx
https://gitlab.com/petsc/petsc/-/blob/main/src/binding/petsc4py/src/petsc4py/PETSc/Vec.pyx
https://github.com/FEniCS/dolfinx/blob/main/python/dolfinx/wrappers/caster_petsc.h

@kwabenantim
Copy link
Member Author

kwabenantim commented Jul 18, 2023

Bad X server connection
Rendering in some tests tries to open a window, which causes an error in a headless environment.

Error

test_construct (cell_based.TestCaBasedCellPopulationPython.TestPottsMesh) ... ERROR: In ./Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx, line 300
vtkXOpenGLRenderWindow (0x5555b3b08a80): bad X server connection. DISPLAY=[fv-az438-312:17440] *** Process received signal ***
[fv-az438-312:17440] Signal: Aborted (6)
[fv-az438-312:17440] Signal code:  (-6)
[fv-az438-312:17440] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f29080c4520]
[fv-az438-312:17440] [ 1] /lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c)[0x7f2908118a7c]
[fv-az438-312:17440] [ 2] /lib/x86_64-linux-gnu/libc.so.6(raise+0x16)[0x7f29080c4476]
[fv-az438-312:17440] [ 3] /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7f29080aa7f3]
[fv-az438-312:17440] [ 4] /lib/x86_64-linux-gnu/libvtkRenderingOpenGL2-7.1.so.7.1p(+0x900a5)[0x7f28fae310a5]
[fv-az438-312:17440] [ 5] /lib/x86_64-linux-gnu/libvtkRenderingOpenGL2-7.1.so.7.1p(_ZN22vtkXOpenGLRenderWindow15GetDesiredDepthEv+0x12)[0x7f28fafbaa12]
[fv-az438-312:17440] [ 6] /lib/x86_64-linux-gnu/libvtkRenderingOpenGL2-7.1.so.7.1p(_ZN26vtkXRenderWindowInteractor10InitializeEv+0x22d)[0x7f28fafb211d]
[fv-az438-312:17440] [ 7] /lib/x86_64-linux-gnu/libvtkRenderingCore-7.1.so.7.1p(_ZN15vtkRenderWindow6RenderEv+0x430)[0x7f28faaf4d90]
[fv-az438-312:17440] [ 8] /lib/x86_64-linux-gnu/libvtkRenderingOpenGL2-7.1.so.7.1p(_ZN22vtkXOpenGLRenderWindow6RenderEv+0x31)[0x7f28fafc0e51]
[fv-az438-312:17440] [ 9] /home/runner/work/PyChaste/PyChaste/Chaste/build/projects/PyChaste/libchaste_project_PyChaste.so(_ZN8VtkSceneILj3EE13ResetRendererEj+0x12b)[0x7f28fc37a21b]
[fv-az438-312:17440] [10] /home/runner/work/PyChaste/PyChaste/Chaste/build/projects/PyChaste/libchaste_project_PyChaste.so(_ZN8VtkSceneILj3EE5StartEv+0xf4)[0x7f28fc379c74]
[fv-az438-312:17440] [11] /home/runner/.local/lib/python3.10/site-packages/chaste/visualization/_chaste_project_PyChaste_visualization.so(+0x3f8a4)[0x7f28f6b908a4]
[fv-az438-312:17440] [12] /home/runner/.local/lib/python3.10/site-packages/chaste/visualization/_chaste_project_PyChaste_visualization.so(+0x20eac)[0x7f28f6b71eac]
[fv-az438-312:17440] [13] python3(+0x15cc9e)[0x5555afe8ec9e]
[fv-az438-312:17440] [14] python3(_PyObject_MakeTpCall+0x25b)[0x5555afe8572b]
[fv-az438-312:17440] [15] python3(+0x16b1eb)[0x5555afe9d1eb]
[fv-az438-312:17440] [16] python3(_PyEval_EvalFrameDefault+0x640a)[0x5555afe7d75a]
[fv-az438-312:17440] [17] python3(+0x16af11)[0x5555afe9cf11]
[fv-az438-312:17440] [18] python3(_PyEval_EvalFrameDefault+0x6cd)[0x5555afe77a1d]
[fv-az438-312:17440] [19] python3(_PyFunction_Vectorcall+0x7c)[0x5555afe8f4ec]
[fv-az438-312:17440] [20] python3(_PyEval_EvalFrameDefault+0x8c4)[0x5555afe77c14]
[fv-az438-312:17440] [21] python3(+0x16b05e)[0x5555afe9d05e]
[fv-az438-312:17440] [22] python3(_PyEval_EvalFrameDefault+0x2a37)[0x5555afe79d87]
[fv-az438-312:17440] [23] python3(_PyObject_FastCallDictTstate+0xc4)[0x5555afe848b4]
[fv-az438-312:17440] [24] python3(_PyObject_Call_Prepend+0x5c)[0x5555afe99f9c]
[fv-az438-312:17440] [25] python3(+0x285050)[0x5555affb7050]
[fv-az438-312:17440] [26] python3(_PyObject_MakeTpCall+0x25b)[0x5555afe8572b]
[fv-az438-312:17440] [27] python3(_PyEval_EvalFrameDefault+0x67dc)[0x5555afe7db2c]
[fv-az438-312:17440] [28] python3(+0x16b05e)[0x5555afe9d05e]
[fv-az438-312:17440] [29] python3(_PyEval_EvalFrameDefault+0x2a37)[0x5555afe79d87]
[fv-az438-312:17440] *** End of error message ***
/home/runner/work/_temp/88502592-3561-46f5-a073-165fa7e5765a.sh: line 6: 17440 Aborted                 (core dumped) python3 -m unittest -v cell_based/Test*.py cell_based/tutorials/Test*.py core/Test*.py mesh/Test*.py ode/Test*.py

Maybe Useful
https://discourse.vtk.org/t/offscreen-rendering-opening-window/1660

Fix
Use xvfb-run to run tests

@kwabenantim
Copy link
Member Author

kwabenantim commented Jul 20, 2023

TestPetscToolsPython Needs wrapping for PETSc Vec and Mat.

It's not clear why this test is needed since we rely on petsc4py. Perhaps better to re-implement PetscTools.{hpp|cpp} in Python using petsc4py?

@kwabenantim
Copy link
Member Author

It's not clear why this test is needed since we rely on petsc4py. Perhaps better to re-implement PetscTools.{hpp|cpp} in Python using petsc4py?

Vet and Mat are wrapped opaquely, so no conversions needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant