File: delay.patch

package info (click to toggle)
libembperl-perl 2.5.0-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 6,200 kB
  • sloc: ansic: 21,387; perl: 14,496; cpp: 467; xml: 49; makefile: 32; sh: 24
file content (44 lines) | stat: -rw-r--r-- 986 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Description: Add additional delay loop to test.pl, for ridiculously slow machines
 (like heavily loaded m68k/arm buildds)
Author: Angus Lees <gus@debian.org>
Forwarded: yes

--- a/test.pl
+++ b/test.pl
@@ -2847,6 +2847,7 @@
 	    }
 
         my $tries = ($opt_gdb || $opt_ddd)?30:15 ;
+	my $delay = 1 ;
         $httpdpid = 0 ;
         my $herr = 0 ;
 
@@ -2870,7 +2871,7 @@
                     }
                 }
 
-            sleep (1) ;
+            sleep ($delay++) ;
             }
         close HERR if ($herr) ;
 
@@ -2879,6 +2880,19 @@
 
         print "pid = $httpdpid  ok\n" ;
 
+	# additional delay step for really slow machines (m68k/arm)
+	$tries = 0 ;
+	while ($tries++ < 8)
+	  {
+	    use IO::Socket::INET;
+	    my $sock = new IO::Socket::INET
+	      PeerAddr => $host,
+	      PeerPort => $port,
+	      Timeout => 10;
+	    last if $sock;	# connected successfully
+	    sleep(1.5**$tries);
+	  }
+
 	close ERR ;
 	if (!open (ERR, "$httpderr"))
             {