Skip to content

Regression: test_tree fails with scip 10.0.2 #1206

@musicinmybrain

Description

@musicinmybrain

Describe the bug

Since Fedora’s scip package was upgraded from 10.0.1 to 10.0.2, the test test_tree fails in PySCIPOpt (python-pyscipopt).

To Reproduce

I originally saw this while building the actual python-pyscipopt RPMs (I maintain this package in Fedora), but I was able to reproduce it in a git checkout as well. You should be able to reproduce it in any environment with SCIP version 10.0.2, I think.

$ mock -r fedora-44-x86_64 --enablerepo=updates-testing -i python3-devel libscip-devel 'gcc-c++' git-core
$ mock -r fedora-44-x86_64 --shell --enable-network
# scip --version
SCIP version 10.0.2 [precision: 8 byte] [memory: block] [mode: optimized] [LP solver: SoPlex 8.0.2] [GitHash: NoGitInfo]
[…]
# git clone https://github.com/scipopt/PySCIPOpt.git
# cd PySCIPOpt
# python3 -m venv _e
# . _e/bin/activate
(_e) # CFLAGS='-I/usr/include/scip' pip install .
(_e) # pip install pytest
(_e) # pytest -v
[…]
========================================================================================= FAILURES ==========================================================================================
_________________________________________________________________________________________ test_tree _________________________________________________________________________________________
                                                                                                                                                                                             
    def test_tree():                                                                                                                                                                         
        # create solver instance                                                                                                                                                             
        s = Model()                                                                                                                                                                          
        s.setMaximize()                                                                                                                                                                      
        s.hideOutput()                                                                                                                                                                       
        s.setPresolve(SCIP_PARAMSETTING.OFF)                                                                                                                                                 
        node_eventhdlr = NodeEventHandler()                                                                                                                                                  
        s.includeEventhdlr(node_eventhdlr, "NodeEventHandler", "python event handler to catch NODEFOCUSED")                                                                                  
                                                                                                                                                                                             
        # add some variables                                                                                                                                                                 
        n = 121                                                                                                                                                                              
        x = [s.addVar("x{}".format(i), obj=1.0, vtype="INTEGER") for i in range(n)]                                                                                                          
                                                                                                                                                                                             
        # add some constraints                                                                                                                                                               
        for i in range(n):                                                                                                                                                                   
          for j in range(i):                                                                                                                                                                 
            dist = min(abs(i - j), abs(n - i - j))                                                                                                                                           
            if dist in (1, 3, 4):                                                                                                                                                            
              s.addCons(x[i] + x[j] <= 1)                                                                                                                                                    
        # solve problem                                                                                                                                                                      
        s.optimize()                                                                                                                                                                         
                                                                                                                                                                                             
        # print solution                                                                                                                                                                     
        assert round(s.getObjVal()) == 36.0                                                                                                                                                  
                                                                                                                                                                                             
        del s                                                                                                                                                                                
                                                                                                                                                                                             
>       assert len(node_eventhdlr.calls) > 3                                                                                                                                                 
E       AssertionError: assert 3 > 3                                                                                                                                                         
E        +  where 3 = len(['eventexec', 'eventexec', 'eventexec'])                                                                                                                           
E        +    where ['eventexec', 'eventexec', 'eventexec'] = <test_tree.NodeEventHandler object at 0x7f67b7d57070>.calls                                                                    
                                                                                                                                                                                             
tests/test_tree.py:63: AssertionError                                                                                                                                                        
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
Traceback (most recent call last):                                                                                                                                                           
  File "/builddir/PySCIPOpt/tests/test_tree.py", line 15, in eventexit                                                                                                                       
    self.model.dropEvent(SCIP_EVENTTYPE.NODEFOCUSED, self)                                                                                                                                   
    ^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                     
ReferenceError: weakly-referenced object no longer exists                                                                                                                                    
[event.c:307] ERROR: Error <0> in function call                                                                                                                                              
[set.c:5766] ERROR: Error <0> in function call                                                                                                                                               
[scip_solve.c:1907] ERROR: Error <0> in function call                                                                                                                                        
[scip_solve.c:3487] ERROR: Error <0> in function call                                                                                                                                        
[scip_prob.c:847] ERROR: Error <0> in function call                                                                                                                                          
[scip_general.c:412] ERROR: Error <0> in function call                                                                                                                                       
Traceback (most recent call last):                                                                                                                                                           
  File "src/pyscipopt/scip.pxi", line 325, in pyscipopt.scip.PY_SCIP_CALL                                                                                                                    
    raise Exception('SCIP: unspecified error!')                                                                                                                                              
Exception: SCIP: unspecified error!                                                                                                                                                          
===================================================================================== warnings summary ======================================================================================
tests/test_event.py::test_raise_error_catch_var_event                                                                                                                                        
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.PyEventInit'              
[...]
tests/test_event.py::test_raise_error_catch_var_event                                                                                                                                        
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.Model.__dealloc__'
[...]
tests/test_model.py::test_solve_concurrent                                                                                                                                                   
  /builddir/PySCIPOpt/tests/test_model.py:95: UserWarning: SCIP was compiled without task processing interface. Parallel solve not possible - using optimize() instead of solveConcurrent()  
    s.solveConcurrent()
[...]
tests/test_pricer.py::test_incomplete_pricer                                                                                                                                                 
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.PyPricerRedcost'
[...]
tests/test_recipe_structured_optimization_trace.py::test_structured_optimization_trace
tests/test_tree.py::test_tree                                                                                                                                                                
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.Model.__dealloc__'        
                                                                                                                                                                                             
  Traceback (most recent call last):                                                                                                                                                         
    File "src/pyscipopt/scip.pxi", line 325, in pyscipopt.scip.PY_SCIP_CALL                                                                                                                  
      raise Exception('SCIP: unspecified error!')                                                                                                                                            
  Exception: SCIP: unspecified error!                                                                                                                                                        
                                                                                                                                                                                             
  Enable tracemalloc to get traceback where the object was allocated.                                                                                                                        
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.                                                                                        
    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))                                                                                                                              
                                                                                                                                                                                             
tests/test_recipe_structured_optimization_trace.py::test_structured_optimization_trace                                                                                                       
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.PyEventExec'
tests/test_recipe_structured_optimization_trace.py::test_structured_optimization_trace                                                                                                       
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.PyEventExec'
[...]
tests/test_tree.py::test_tree                                                                                                                                                                
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.PyEventExit'              
                                                                                                                                                                                             
  Traceback (most recent call last):                                                                                                                                                         
    File "/builddir/PySCIPOpt/tests/test_tree.py", line 15, in eventexit                                                                                                                     
      self.model.dropEvent(SCIP_EVENTTYPE.NODEFOCUSED, self)                                                                                                                                 
      ^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                   
  ReferenceError: weakly-referenced object no longer exists                                                                                                                                  
                                                                                                                                                                                             
  Enable tracemalloc to get traceback where the object was allocated.                                                                                                                        
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.                                                                                        
    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))                                                                                                                              
                                                                                                                                                                                             
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html                                                                                                                      
================================================================================== short test summary info ==================================================================================
FAILED tests/test_tree.py::test_tree - AssertionError: assert 3 > 3                                                                                                                          
============================================================ 1 failed, 419 passed, 111 skipped, 11 xfailed, 8 warnings in 49.59s ============================================================

Expected behavior

===================================================================================== warnings summary ======================================================================================
tests/test_event.py::test_raise_error_catch_var_event                                                                                                                                        
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.PyEventInit'
[...]
tests/test_event.py::test_raise_error_catch_var_event                                                                                                                                        
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.Model.__dealloc__'
[...]
tests/test_model.py::test_solve_concurrent                                                                                                                                                   
  /builddir/PySCIPOpt/tests/test_model.py:95: UserWarning: SCIP was compiled without task processing interface. Parallel solve not possible - using optimize() instead of solveConcurrent()  
    s.solveConcurrent()
[...]
tests/test_pricer.py::test_incomplete_pricer                                                                                                                                                 
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.PyPricerRedcost'
[...]
tests/test_recipe_primal_dual_evolution.py::test_primal_dual_evolution                                                                                                                       
tests/test_recipe_structured_optimization_trace.py::test_structured_optimization_trace                                                                                                       
tests/test_tree.py::test_tree                                                                                                                                                                
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.Model.__dealloc__'        
                                                                                                                                                                                             
  Traceback (most recent call last):                                                                                                                                                         
    File "src/pyscipopt/scip.pxi", line 325, in pyscipopt.scip.PY_SCIP_CALL                                                                                                                  
      raise Exception('SCIP: unspecified error!')                                                                                                                                            
  Exception: SCIP: unspecified error!                                                                                                                                                        
                                                                                                                                                                                             
  Enable tracemalloc to get traceback where the object was allocated.                                                                                                                        
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.                                                                                        
    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))                                                                                                                              
                                                                                                                                                                                             
tests/test_recipe_primal_dual_evolution.py::test_primal_dual_evolution                                                                                                                       
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.PyEventExec'
[...]
tests/test_recipe_structured_optimization_trace.py::test_structured_optimization_trace                                                                                                       
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.PyEventExec'
[...]
tests/test_tree.py::test_tree                                                                                                                                                                
  /builddir/PySCIPOpt/_e/lib64/python3.14/site-packages/_pytest/unraisableexception.py:67: PytestUnraisableExceptionWarning: Exception ignored in: 'pyscipopt.scip.PyEventExit'              
                                                                                                                                                                                             
  Traceback (most recent call last):                                                                                                                                                         
    File "/builddir/PySCIPOpt/tests/test_tree.py", line 15, in eventexit                                                                                                                     
      self.model.dropEvent(SCIP_EVENTTYPE.NODEFOCUSED, self)                                                                                                                                 
      ^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                   
  ReferenceError: weakly-referenced object no longer exists                                                                                                                                  
                                                                                                                                                                                             
  Enable tracemalloc to get traceback where the object was allocated.                                                                                                                        
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.                                                                                        
    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))                                                                                                                              
                                                                                                                                                                                             
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html                                                                                                                      
================================================================ 420 passed, 111 skipped, 11 xfailed, 10 warnings in 50.32s =================================================================

Screenshots

Full scip --version output:

SCIP version 10.0.2 [precision: 8 byte] [memory: block] [mode: optimized] [LP solver: SoPlex 8.0.2] [GitHash: NoGitInfo]
Copyright (c) 2002-2026 Zuse Institute Berlin (ZIB)

External libraries: 
  Readline 8.3         GNU library for command line editing (gnu.org/s/readline)
  SoPlex 8.0.2         Linear programming solver developed at Zuse Institute Berlin (soplex.zib.de) [GitHash: NoGitInf]
  CppAD 20180000.0     Algorithmic Differentiation of C++ algorithms developed by B. Bell (github.com/coin-or/CppAD)
  ZLIB-NG 2.3.3        General purpose compression library by J. Gailly and M. Adler (zlib.net)
  MPFR 4.2.2           GNU Multiple Precision Floating-Point Reliable Library (mpfr.org)
  Boost 1.90.0         Boost C++ Libraries (boost.org)
  OpenMP 202111        shared-memory multiprocessing library (openmp.org)
  GMP 6.3.0            GNU Multiple Precision Arithmetic Library developed by T. Granlund (gmplib.org)
  ZIMPL 3.7.1          Zuse Institute Mathematical Programming Language developed by T. Koch (zimpl.zib.de)
  AMPL/MP 4.0.4        AMPL .nl file reader library (github.com/ampl/mp)
  PaPILO 3.0.0         parallel presolve for integer and linear optimization (github.com/scipopt/papilo) (built with TBB)
  Nauty 2.9.N          Computing Graph Automorphism Groups by Brendan D. McKay (users.cecs.anu.edu.au/~bdm/nauty)
  sassy 2.1            Symmetry preprocessor by Markus Anders (github.com/markusa4/sassy)
  Ipopt 3.14.16        Interior Point Optimizer developed by A. Waechter et.al. (github.com/coin-or/Ipopt)

Compiler: gcc 16.0.1

Build options:
 ARCH=x86_64
 OSTYPE=linux
 COMP=GNU 16.0.1
 BUILD=Release
 CHECKSTAGE=AUTO
 DEBUGSOL=OFF
 EXPRINT=cppad
 SYM=snauty
 GMP=ON
 CONOPT=OFF
 IPOPT=ON
 WORHP=OFF
 LPS=spx
 LPSCHECK=OFF
 LTO=OFF
 NOBLKBUFMEM=OFF
 NOBLKMEM=OFF
 NOBUFMEM=OFF
 THREADSAFE=ON;FORCE
 READLINE=ON
 SANITIZE=OFF
 SHARED=ON
 VERSION=10.0.2
 API_VERSION=156
 ZIMPL=ON

System

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • SCIP version
  • How did you install pyscipopt?

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions