@@ -25,7 +25,7 @@ lxc.mount.auto=proc:rw sys:rw cgroup:rw
25
25
lxc.cgroup.devices.allow=a
26
26
lxc.cap.drop=`
27
27
const checkInternet = `#!/bin/bash
28
- timeout 5 bash -c 'cat < /dev/null > /dev/tcp/www .replicated.com/80'
28
+ timeout 5 bash -c 'cat < /dev/null > /dev/tcp/api .replicated.com/80'
29
29
if [ $? == 0 ]; then
30
30
exit 0
31
31
fi
@@ -571,20 +571,22 @@ func NodeHasInternet(in *Input, node string) {
571
571
Line : []string {"/usr/local/bin/check_internet.sh" },
572
572
}
573
573
var success bool
574
- for i := 0 ; i < 10 ; i ++ {
574
+ var lastErr error
575
+ for i := 0 ; i < 60 ; i ++ {
575
576
ctx , cancel := context .WithTimeout (context .Background (), 10 * time .Second )
576
577
defer cancel ()
577
578
if err := Run (ctx , in .T , cmd ); err != nil {
578
- in . T . Logf ( "Unable to reach internet from %s : %v", node , err )
579
- time .Sleep (30 * time .Second )
579
+ lastErr = fmt . Errorf ( "failed to check internet: %v" , err )
580
+ time .Sleep (5 * time .Second )
580
581
continue
581
582
}
582
583
success = true
583
584
break
584
585
}
585
586
if ! success {
586
- in .T .Fatalf ("Unable to reach internet from %s" , node )
587
+ in .T .Fatalf ("Timed out trying to reach internet from %s: %v " , node , lastErr )
587
588
}
589
+ in .T .Logf ("Node %s can reach the internet" , node )
588
590
}
589
591
590
592
// CreateNode creates a single node. The i here is used to create a unique
0 commit comments