Skip to content

Commit 14bd908

Browse files
committed
Fix unit tests: lower max_fds
Apparently 3 more fds are used now, with 10 it fails, with 11 it passes. Signed-off-by: Edwin Török <[email protected]>
1 parent 3b10c05 commit 14bd908

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ clean:
2020
dune clean
2121

2222
test:
23-
dune runtest --profile=release
23+
dune runtest --profile=release --no-buffer
2424

2525
# requires odoc
2626
doc:

test/fe_test.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type config = {
1717
}
1818

1919
let min_fds = 7
20-
let max_fds = 1024 - 8 (* fe daemon has a bunch for its own use *)
20+
let max_fds = 1024 - 11 (* fe daemon has a bunch for its own use *)
2121

2222
let all_combinations fds =
2323
let y = {
@@ -114,12 +114,13 @@ let test_exitcode () =
114114
Printf.printf "\nCompleted exitcode tests\n"
115115

116116
let master fds =
117+
Printf.printf "\nPerforming timeout tests\n%!";
117118
test_delay ();
118119
test_notimeout ();
119-
Printf.printf "\nCompleted timeout test\n";
120+
Printf.printf "\nCompleted timeout test\n%!";
120121
test_exitcode ();
121122
let combinations = shuffle (all_combinations fds) in
122-
Printf.printf "Starting %d tests\n" (List.length combinations);
123+
Printf.printf "Starting %d tests\n%!" (List.length combinations);
123124
let i = ref 0 in
124125
let update_progress f x =
125126
incr i;

test/fe_test.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#!/bin/sh
22

33
../src/fe_main.exe &
4-
for x in `seq 1 10`; do
4+
MAIN=$!
5+
cleanup () {
6+
kill $MAIN
7+
}
8+
trap cleanup EXIT
9+
for _ in $(seq 1 10); do
510
test -S /var/xapi/forker/main || sleep 1
611
done
712
./fe_test.exe 16

0 commit comments

Comments
 (0)