Skip to content

Commit

Permalink
Merge pull request #1210 from fl4via/TEST_FIXES_2.0.x
Browse files Browse the repository at this point in the history
Test fixes for maintenance branch
  • Loading branch information
fl4via committed Jul 19, 2021
2 parents b6189e4 + 8f51b19 commit 046f370
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Expand Up @@ -22,6 +22,7 @@
import io.undertow.testutils.DefaultServer;
import io.undertow.testutils.HttpOneOnly;
import io.undertow.testutils.ProxyIgnore;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
Expand Down Expand Up @@ -54,6 +55,7 @@ public void before() throws Exception {
clientInputStream = client.getInputStream();
}

@After
public void after() throws Exception {
IoUtils.safeClose(client);
DefaultServer.setUndertowOptions(OptionMap.EMPTY);
Expand Down
15 changes: 13 additions & 2 deletions core/src/test/java/io/undertow/server/WriteTimeoutTestCase.java
Expand Up @@ -35,23 +35,34 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.xnio.ChannelListener;
import org.xnio.OptionMap;
import org.xnio.Options;
import org.xnio.channels.StreamSinkChannel;
import org.xnio.channels.WriteTimeoutException;

/**
* Tests read timeout with a client that is slow to read the response
* Tests write timeout with a client that is slow to read the response
*
* @author Stuart Douglas
*/
@RunWith(DefaultServer.class)
@HttpOneOnly
@Ignore("This test fails intermittently")
@Ignore("UNDERTOW-1859 this test freezes") //FIXME
public class WriteTimeoutTestCase {

private volatile Exception exception;
private static final CountDownLatch errorLatch = new CountDownLatch(1);

@DefaultServer.BeforeServerStarts
public static void setup() {
DefaultServer.setServerOptions(OptionMap.builder().set(Options.WRITE_TIMEOUT, 10).getMap());
}

@DefaultServer.AfterServerStops
public static void cleanup() {
DefaultServer.setServerOptions(OptionMap.EMPTY);
}

@Test
public void testWriteTimeout() throws IOException, InterruptedException {
DefaultServer.setRootHandler(new HttpHandler() {
Expand Down
Expand Up @@ -45,6 +45,7 @@
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;

Expand Down Expand Up @@ -107,6 +108,7 @@ public void complexSSLTestCase() throws IOException, GeneralSecurityException, U
}

@Test
@Ignore // FIXME UNDERTOW-1918
public void testSslLotsOfData() throws IOException, GeneralSecurityException, URISyntaxException {

DefaultServer.setRootHandler(new HttpHandler() {
Expand Down

0 comments on commit 046f370

Please sign in to comment.