Speed up checking if mount works
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
Nov 1, 2014 at 15:29 UTC
630816c7ee5f50dfcdea9d1036d2007288dc8b1f
1 file changed
+10
-2
test/test-lib.sh
+10
-2
@@ -16,6 +16,15 @@
16
17
# Please put go-ipfs specific shell functions below
18
19
+test_cmp_repeat_10_sec() {
20
+ for i in 1 2 3 4 5 6 7 8 9 10
21
+ do
22
+ test_cmp "$1" "$2" && return
23
+ sleep 1
24
+ done
25
+ test_cmp "$1" "$2"
26
+}
27
+
28
test_launch_ipfs_mount() {
29
30
test_expect_success "ipfs init succeeds" '
@@ -35,10 +44,9 @@ test_launch_ipfs_mount() {
44
45
test_expect_success "ipfs mount output looks good" '
46
IPFS_PID=$! &&
38
- sleep 5 &&
47
echo "mounting ipfs at $(pwd)/ipfs" >expected &&
48
echo "mounting ipns at $(pwd)/ipns" >>expected &&
41
- test_cmp expected actual
49
+ test_cmp_repeat_10_sec expected actual
50
'
51
}
52