Skip to content

Commit c71c7f2

Browse files
author
Stephane Landelle
committed
Workaround for test thread safety issue
1 parent e2401e8 commit c71c7f2

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

api/src/test/java/org/asynchttpclient/async/HttpToHttpsRedirectTest.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,15 @@ private static int getPort(URI uri) {
134134
}
135135

136136
@Test(groups = { "standalone", "default_provider" })
137-
public void httpToHttpsRedirect() throws Throwable {
137+
// FIXME find a way to make this threadsafe, other, set @Test(singleThreaded = true)
138+
public void httpToHttpsRunAllTestsSequentially() throws Exception {
139+
httpToHttpsRedirect();
140+
httpToHttpsProperConfig();
141+
relativeLocationUrl();
142+
}
143+
144+
// @Test(groups = { "standalone", "default_provider" })
145+
public void httpToHttpsRedirect() throws Exception {
138146
isSet.getAndSet(false);
139147

140148
AsyncHttpClientConfig cg = new AsyncHttpClientConfig.Builder().setMaximumNumberOfRedirects(5).setFollowRedirects(true).build();
@@ -153,8 +161,8 @@ public String getTargetUrl2() {
153161
return String.format("https://127.0.0.1:%d/foo/test", port2);
154162
}
155163

156-
@Test(groups = { "standalone", "default_provider" })
157-
public void httpToHttpsProperConfig() throws Throwable {
164+
// @Test(groups = { "standalone", "default_provider" })
165+
public void httpToHttpsProperConfig() throws Exception {
158166
isSet.getAndSet(false);
159167

160168
AsyncHttpClientConfig cg = new AsyncHttpClientConfig.Builder().setMaximumNumberOfRedirects(5).setFollowRedirects(true).build();
@@ -175,8 +183,8 @@ public void httpToHttpsProperConfig() throws Throwable {
175183
}
176184
}
177185

178-
@Test(groups = { "standalone", "default_provider" })
179-
public void relativeLocationUrl() throws Throwable {
186+
// @Test(groups = { "standalone", "default_provider" })
187+
public void relativeLocationUrl() throws Exception {
180188
isSet.getAndSet(false);
181189

182190
AsyncHttpClientConfig cg = new AsyncHttpClientConfig.Builder().setMaximumNumberOfRedirects(5).setFollowRedirects(true).build();

0 commit comments

Comments
 (0)