Skip to content

Commit

Permalink
Fluke test: WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Flavia Rainone <[email protected]>
  • Loading branch information
fl4via committed Sep 25, 2024
1 parent e17e84d commit f39973d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
module: [core, servlet, websockets-jsr]
module: [core]
jdk: [11, 17, 21]
openjdk_impl: [ temurin ]
steps:
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
- name: Print Version
run: mvn -v
- name: Run Tests
run: mvn -U -B -fae test -Pproxy '-DfailIfNoTests=false' -pl ${{ matrix.module }}
run: mvn -U -B -fae test -Dtest=PushResourceRSTTestCase '-DfailIfNoTests=false' -pl ${{ matrix.module }}
- uses: actions/upload-artifact@v4
if: failure()
with:
Expand All @@ -120,8 +120,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
module: [core, servlet, websockets-jsr]
proxy: ['-Pproxy', '']
module: [core]
proxy: ['']
jdk: [11]
steps:
- name: Update hosts - linux
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
- name: Print Version
run: mvn -v
- name: Run Tests
run: mvn -U -B -fae test ${{ matrix.proxy }} '-DfailIfNoTests=false' -pl ${{ matrix.module }} -Dtest.ipv6=true
run: mvn -U -B -fae test ${{ matrix.proxy }} '-Dtest=PushResourceRSTTestCase' '-DfailIfNoTests=false' -pl ${{ matrix.module }} -Dtest.ipv6=true
- uses: actions/upload-artifact@v4
if: failure()
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

import org.jboss.logging.Logger;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Assume;
Expand Down Expand Up @@ -90,6 +91,7 @@
@ProxyIgnore
@AjpIgnore
public class PushResourceRSTTestCase {
private static final Logger log = Logger.getLogger(PushResourceRSTTestCase.class);
private static final String PUSHER = "/pusher";
private static final String PUSHER_MSG;
private static final String TRIGGER = "/trigger";
Expand Down Expand Up @@ -240,18 +242,30 @@ private ClientCallback<ClientExchange> createClientCallback(final List<ClientRes
final CountDownLatch latch, final AtomicInteger pushRstCount) {
return new ClientCallback<>() {
@Override
public void completed(ClientExchange result) {
public void completed(final ClientExchange result) {
result.setPushHandler(new PushCallback() {
@Override
public boolean handlePush(ClientExchange originalRequest, ClientExchange pushedRequest) {
pushRstCount.incrementAndGet();
log.debugf("Handling push %d", pushRstCount.get());
latch.countDown();
setUpResponseListenerAndShutdownWrites(result);
return false;
}
});
}
@Override
public void failed(IOException e) {
e.printStackTrace();
exception = e;
latch.countDown();
}

private void setUpResponseListenerAndShutdownWrites(ClientExchange result) {
result.setResponseListener(new ClientCallback<>() {
@Override
public void completed(final ClientExchange result) {
log.debugf("Got result %s", result);
responses.add(result.getResponse());
new StringReadChannelListener(result.getConnection().getBufferPool()) {

Expand Down Expand Up @@ -290,13 +304,6 @@ public void failed(IOException e) {
latch.countDown();
}
}

@Override
public void failed(IOException e) {
e.printStackTrace();
exception = e;
latch.countDown();
}
};
}
}

0 comments on commit f39973d

Please sign in to comment.