Fixes #2627 - Improve QoSFilterTest (#6120)

* Fixes #2627

Reenable disabled test with longer sleep time

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* update from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
Greg Wilkins 2021-05-16 08:35:53 +10:00 committed by GitHub
parent 4204526d2f
commit 292a9fb52c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 14 deletions

View File

@ -41,7 +41,6 @@ import org.eclipse.jetty.util.component.LifeCycle;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -100,13 +99,9 @@ public class QoSFilterTest
rethrowExceptions(futures);
if (TestServlet.__maxSleepers <= maxQos)
LOG.warn("TEST WAS NOT PARALLEL ENOUGH!");
else
assertThat(TestServlet.__maxSleepers, Matchers.lessThanOrEqualTo(numConnections));
assertThat(TestServlet.__maxSleepers, Matchers.lessThanOrEqualTo(numConnections));
}
@Disabled("Issue #2627")
@Test
public void testBlockingQosFilter() throws Exception
{
@ -126,10 +121,7 @@ public class QoSFilterTest
rethrowExceptions(futures);
if (TestServlet.__maxSleepers < maxQos)
LOG.warn("TEST WAS NOT PARALLEL ENOUGH!");
else
assertEquals(TestServlet.__maxSleepers, maxQos);
assertEquals(TestServlet.__maxSleepers, maxQos);
}
@Test
@ -151,10 +143,7 @@ public class QoSFilterTest
rethrowExceptions(futures);
if (TestServlet.__maxSleepers < maxQos)
LOG.warn("TEST WAS NOT PARALLEL ENOUGH!");
else
assertEquals(TestServlet.__maxSleepers, maxQos);
assertEquals(TestServlet.__maxSleepers, maxQos);
}
private void rethrowExceptions(List<Future<Void>> futures) throws Exception