diff --git a/test/porousmediumflow/2p/implicit/incompressible/CMakeLists.txt b/test/porousmediumflow/2p/implicit/incompressible/CMakeLists.txt
index 43b888d2366b962ec212ef68184678aa3b270bec..b87adb52cc582ef56f3d793e556cbf02bb7c02a6 100644
--- a/test/porousmediumflow/2p/implicit/incompressible/CMakeLists.txt
+++ b/test/porousmediumflow/2p/implicit/incompressible/CMakeLists.txt
@@ -20,6 +20,9 @@ dune_add_test(NAME test_2p_incompressible_tpfa_restart
                                ${CMAKE_CURRENT_BINARY_DIR}/2p_tpfa_restart-00003.vtu
                        --command "${CMAKE_CURRENT_BINARY_DIR}/test_2p_incompressible_tpfa_restart test_2p.input -Problem.Name 2p_tpfa_restart  -TimeLoop.DtInitial 526.62 -Restart.Time 1859.95 -Restart.File 2p_tpfa-00005.vtu")
 
+# the restart test has to run after the test that produces the corresponding vtu file
+set_tests_properties(test_2p_incompressible_tpfa_restart PROPERTIES DEPENDS test_2p_incompressible_tpfa)
+
 # using box
 dune_add_test(NAME test_2p_incompressible_box
               SOURCES test_2p_fv.cc
diff --git a/test/porousmediumflow/2p2c/implicit/CMakeLists.txt b/test/porousmediumflow/2p2c/implicit/CMakeLists.txt
index da8153e19428f076676bff822bae0ba6048b6b7c..cb6d43b971ba1c5bc38ab7df7f373c2cb35dfa38 100644
--- a/test/porousmediumflow/2p2c/implicit/CMakeLists.txt
+++ b/test/porousmediumflow/2p2c/implicit/CMakeLists.txt
@@ -21,6 +21,9 @@ dune_add_test(NAME test_2p2c_box_restart
                                ${CMAKE_CURRENT_BINARY_DIR}/injection_box_restart-00004.vtu
                        --command "${CMAKE_CURRENT_BINARY_DIR}/test_2p2c_box test_2p2c_fv.input -Problem.Name injection_box_restart -TimeLoop.DtInitial 1488.5 -Restart.Time 2158.85 -Restart.File injection_box-00004.vtu")
 
+# the restart test has to run after the test that produces the corresponding vtu file
+set_tests_properties(test_2p2c_box_restart PROPERTIES DEPENDS test_2p2c_box)
+
 dune_add_test(NAME test_2p2c_tpfa
               SOURCES test_2p2c_fv.cc
               COMPILE_DEFINITIONS TYPETAG=InjectionCCTpfaTypeTag ENABLECACHING=0