Fix RestartSchedulerTests

Summary:
The RestartSchedulerTests were failing because they are run in parallel by OUnit and all share the same output
directory. This makes the different tests collide since they are using the same file locks directory.

Reviewed By: jvillard

Differential Revision: D19765647

fbshipit-source-id: 5390ad14e
master
Fernando Gasperi Jabalera 5 years ago committed by Facebook Github Bot
parent 43e857ccb3
commit 0b22fbb01b

@ -10,33 +10,23 @@ open OUnit2
let a_pname = Procname.from_string_c_fun "a_c_fun_name"
let test_try_lock_already_locked _test_ctxt =
let tests_wrapper _test_ctxt =
ProcLocker.(
setup () ;
(* When tries to lock a Procname that was already locked it fails *)
try_lock a_pname |> ignore ;
assert_bool "Should not be able to lock a Procname that's already locked."
(not (try_lock a_pname)))
let test_lock_after_unlock _test_ctxt =
ProcLocker.(
setup () ;
(not (try_lock a_pname)) ;
unlock a_pname ;
(* When successives locks/unlocks are performed in the right order they succeed *)
try_lock a_pname |> ignore ;
unlock a_pname ;
try_lock a_pname |> ignore ;
unlock a_pname)
let test_unlocking_unlocked_fails _text_ctxt =
ProcLocker.(
setup () ;
unlock a_pname ;
(* When an unlock is performed over a non-locked Procname it fails *)
try_lock a_pname |> ignore ;
unlock a_pname ;
assert_raises (UnlockNotLocked a_pname) (fun () -> unlock a_pname))
let tests =
"restart_scheduler_suite"
>::: [ "test_try_lock_already_locked" >:: test_try_lock_already_locked
; "test_lock_after_unlock" >:: test_lock_after_unlock
; "test_unlocking_unlocked_fails" >:: test_unlocking_unlocked_fails ]
let tests = "restart_scheduler_suite" >:: tests_wrapper

@ -40,13 +40,13 @@ let () =
; MaximumSharingTests.tests
; PerfProfilerATDParserTest.tests
; ProcCfgTests.tests
; RestartSchedulerTests.tests
; SchedulerTests.tests
; SeverityTests.tests
; TaintTests.tests
; TraceTests.tests
; WeakTopologicalOrderTests.tests ]
@ ClangTests.tests @ AllNullsafeTests.tests )
@ [RestartSchedulerTests.tests]
in
let test_suite = "all" >::: tests in
OUnit2.run_test_tt_main test_suite

Loading…
Cancel
Save