Skip to content

Commit f14fcdf

Browse files
authored
Delay: wait a bit more testing the module (#6162)
In some environments the time ranges checked are too strict causing test to fail. Previously the maximum error accepted was 10 ms, increase to 50 ms. Also increase timeouts to reduce error/value ratio.
2 parents 4d3c669 + f936acb commit f14fcdf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ocaml/libs/xapi-stdext/lib/xapi-stdext-threads/threadext_test.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ Single simple signal stored
3131
let simple () =
3232
let d = Delay.make () in
3333
Delay.signal d ;
34-
delay_wait_check ~min:0. ~max:0.01 d 1.0 false
34+
delay_wait_check ~min:0. ~max:0.05 d 1.0 false
3535

3636
(*
3737
No signal
3838
- wait on same thread should timeout more or less on delay
3939
*)
4040
let no_signal () =
4141
let d = Delay.make () in
42-
delay_wait_check ~min:0.1 ~max:0.11 d 0.1 true
42+
delay_wait_check ~min:0.2 ~max:0.25 d 0.2 true
4343

4444
(*
4545
Signal twice, collapsed
@@ -52,8 +52,8 @@ let collapsed () =
5252
let d = Delay.make () in
5353
Delay.signal d ;
5454
Delay.signal d ;
55-
delay_wait_check ~min:0. ~max:0.01 d 0.1 false ;
56-
delay_wait_check ~min:0.1 ~max:0.11 d 0.1 true
55+
delay_wait_check ~min:0. ~max:0.05 d 0.2 false ;
56+
delay_wait_check ~min:0.2 ~max:0.25 d 0.2 true
5757

5858
(*
5959
Signal from another thread
@@ -62,8 +62,8 @@ Signal from another thread
6262
*)
6363
let other_thread () =
6464
let d = Delay.make () in
65-
let th = Thread.create (fun d -> Thread.delay 0.1 ; Delay.signal d) d in
66-
delay_wait_check ~min:0.1 ~max:0.11 d 1.0 false ;
65+
let th = Thread.create (fun d -> Thread.delay 0.2 ; Delay.signal d) d in
66+
delay_wait_check ~min:0.2 ~max:0.25 d 1.0 false ;
6767
Thread.join th
6868

6969
let tests =

0 commit comments

Comments
 (0)