Skip to content

Commit 9b4393b

Browse files
committed
Avoid connection refused errors by leaving some time between the gets, works locally lets see if it also works for jenkins
1 parent ad49c5b commit 9b4393b

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/tests/antunit/taskdefs/get-test.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
<import file="../antunit-base.xml" />
2121

2222
<property name="location" value="https://ant.apache.org/webtest/gettest" />
23+
<property name="unsecurelocation" value="http://ant.apache.org/webtest/gettest/http-to-https.txt" />
2324

2425
<target name="setUp">
2526
<mkdir dir="${output}" />
2627
</target>
2728

2829
<target name="testSeeOtherRedirect">
30+
<sleep milliseconds="250"/>
2931
<get src="${location}/other.txt" dest="${output}/other.tmp"/>
3032
<au:assertTrue>
3133
<resourcecount count="1">
@@ -39,6 +41,7 @@
3941
</target>
4042

4143
<target name="testPermanentRedirect">
44+
<sleep milliseconds="250"/>
4245
<get src="${location}/permanent.txt" dest="${output}/permanent.tmp"/>
4346
<au:assertTrue>
4447
<resourcecount count="1">
@@ -52,6 +55,7 @@
5255
</target>
5356

5457
<target name="testTemporaryRedirect">
58+
<sleep milliseconds="250"/>
5559
<get src="${location}/temp.txt" dest="${output}/temp.txt"/>
5660
<au:assertTrue>
5761
<resourcecount count="1">
@@ -65,6 +69,7 @@
6569
</target>
6670

6771
<target name="testStatusCode307Redirect">
72+
<sleep milliseconds="250"/>
6873
<get src="${location}/307.txt" dest="${output}/307.txt"/>
6974
<au:assertTrue>
7075
<resourcecount count="1">
@@ -78,6 +83,7 @@
7883
</target>
7984

8085
<target name="test5LevelsOfRedirect">
86+
<sleep milliseconds="250"/>
8187
<get src="${location}/redir5.txt" dest="${output}/redir5.tmp"/>
8288
<au:assertTrue>
8389
<resourcecount count="1">
@@ -95,13 +101,15 @@
95101

96102

97103
<target name="testInfiniteRedirect" unless="jenkins">
104+
<sleep milliseconds="250"/>
98105
<au:expectfailure expectedmessage="More than 25 times redirected, giving up">
99106
<get src="${location}/infinite.txt" dest="${output}/infinite.tmp"/>
100107
</au:expectfailure>
101108
</target>
102109

103110

104111
<target name="testNestedResources">
112+
<sleep milliseconds="250"/>
105113
<get dest="${output}/downloads">
106114
<url url="https://ant.apache.org/index.html"/>
107115
<url url="https://ant.apache.org/faq.html"/>
@@ -111,6 +119,7 @@
111119
</target>
112120

113121
<target name="XtestRelativeRedirect">
122+
<sleep milliseconds="250"/>
114123
<get src="${location}/local.cgi" dest="${output}/other.tmp"/>
115124
<au:assertTrue>
116125
<resourcecount count="1">
@@ -125,7 +134,8 @@
125134

126135
<target name="testHttpToHttpsRedirect" description="Tests that a resource that's redirected
127136
from HTTP to HTTPS works without an error. See bugzilla-62499 for details">
128-
<get src="${location}/http-to-https.txt" dest="${output}/http-to-https-redirect.tmp"/>
137+
<sleep milliseconds="250"/>
138+
<get src="${unsecurelocation}" dest="${output}/http-to-https-redirect.tmp"/>
129139
<au:assertFileExists file="${output}/http-to-https-redirect.tmp"/>
130140
<au:assertTrue>
131141
<resourcecontains resource="${output}/http-to-https-redirect.tmp" substring="hello world"/>

src/tests/antunit/taskdefs/gunzip-test.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
</target>
4040

4141
<target name="testWithNonFileResourceToFile" depends="setup">
42+
<sleep milliseconds="250"/>
4243
<gunzip dest="${output}/greeting.txt">
4344
<url url="https://ant.apache.org/webtest/gunzip/greeting.txt.gz"/>
4445
</gunzip>
@@ -49,6 +50,7 @@
4950
</target>
5051

5152
<target name="testWithNonFileResourceToDir" depends="setup">
53+
<sleep milliseconds="250"/>
5254
<gunzip dest="${output}">
5355
<url url="https://ant.apache.org/webtest/gunzip/greeting.txt.gz"/>
5456
</gunzip>

0 commit comments

Comments
 (0)