diff --git a/src/DIRAC/Core/Utilities/test/Test_Profiler.py b/src/DIRAC/Core/Utilities/test/Test_Profiler.py index 601025c7479..375a68cf958 100644 --- a/src/DIRAC/Core/Utilities/test/Test_Profiler.py +++ b/src/DIRAC/Core/Utilities/test/Test_Profiler.py @@ -76,8 +76,10 @@ def test_base(): assert resWC["Value"] >= 0 assert resWC["Value"] >= res["Value"] + mainProcess.kill() + mainProcess.wait() + -@pytest.mark.flaky(reruns=10) def test_cpuUsage(): mainProcess = Popen( [ @@ -147,6 +149,7 @@ def test_cpuUsage(): assert resTC["Value"] >= res["Value"] # After this the main process will no-longer exist + mainProcess.kill() mainProcess.wait() res = p.cpuUsageUser() diff --git a/src/DIRAC/tests/Utilities/ProcessesCreator_withChildren.py b/src/DIRAC/tests/Utilities/ProcessesCreator_withChildren.py index 015480dca84..8b78db12314 100644 --- a/src/DIRAC/tests/Utilities/ProcessesCreator_withChildren.py +++ b/src/DIRAC/tests/Utilities/ProcessesCreator_withChildren.py @@ -26,3 +26,8 @@ def do_sum(args): p.daemon = False p.start() p.join() + + # On fast machines, this can finish too quickly + # Just sleep (we've accumulated usage now) + # and the test can interrupt this with a kill + time.sleep(60)