Merge pull request #9011 from eclipse/fix/jetty-10-9009-flaky-StreamCloseTest

Fixes #9009 - Flaky test StreamCloseTest.testRequestDataClosedRespons…
This commit is contained in:
Joakim Erdfelt 2022-12-06 10:29:10 -06:00 committed by GitHub
commit e923123a32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -14,6 +14,7 @@
package org.eclipse.jetty.http2.client;
import java.nio.ByteBuffer;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
@ -38,6 +39,8 @@ import org.eclipse.jetty.util.FuturePromise;
import org.eclipse.jetty.util.Promise;
import org.junit.jupiter.api.Test;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
@ -179,7 +182,7 @@ public class StreamCloseTest extends AbstractTest
assertTrue(serverDataLatch.await(5, TimeUnit.SECONDS));
assertTrue(completeLatch.await(5, TimeUnit.SECONDS));
assertTrue(stream.isClosed());
assertEquals(0, stream.getSession().getStreams().size());
await().atMost(Duration.ofSeconds(5)).until(() -> stream.getSession().getStreams().size(), equalTo(0));
}
@Test