Skip to content

Commit

Permalink
Debugging info
Browse files Browse the repository at this point in the history
Signed-off-by: jansupol <[email protected]>
  • Loading branch information
jansupol committed May 24, 2024
1 parent e7f7d18 commit 65594e5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;
import jakarta.ws.rs.client.ClientRequestContext;
import jakarta.ws.rs.client.ClientRequestFilter;
import jakarta.ws.rs.client.InvocationCallback;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.Application;
Expand Down Expand Up @@ -182,11 +184,20 @@ public void testAsyncClientRequests() throws InterruptedException {
cc.property(ApacheClientProperties.CONNECTION_MANAGER, connectionManager);
cc.connectorProvider(new ApacheConnectorProvider());
Client client = ClientBuilder.newClient(cc);
client.register(new ClientRequestFilter() {
@Override
public void filter(ClientRequestContext requestContext) throws IOException {
Logger.getLogger(HelloWorldTest.class.getName()).info("Sending testAsyncClientRequest");
Logger.getLogger(HelloWorldTest.class.getName()).info(Thread.currentThread().getClass().getName());
Logger.getLogger(HelloWorldTest.class.getName()).info(Thread.currentThread().getName());
}
});
WebTarget target = client.target(getBaseUri());
final int REQUESTS = 20;
final CountDownLatch latch = new CountDownLatch(REQUESTS);
final long tic = System.currentTimeMillis();
final Map<Integer, String> results = new ConcurrentHashMap<Integer, String>();
Logger.getLogger(HelloWorldTest.class.getName()).info("Starting testAsyncClientRequests in:" + tic);
for (int i = 0; i < REQUESTS; i++) {
final int id = i;
target.path(ROOT_PATH).request().async().get(new InvocationCallback<Response>() {
Expand All @@ -197,6 +208,7 @@ public void completed(Response response) {
results.put(id, result);
} finally {
latch.countDown();
Logger.getLogger(HelloWorldTest.class.getName()).info("CountDown");
}
}

Expand All @@ -205,12 +217,15 @@ public void failed(Throwable error) {
Logger.getLogger(HelloWorldTest.class.getName()).log(Level.SEVERE, "Failed on throwable", error);
results.put(id, "error: " + error.getMessage());
latch.countDown();
Logger.getLogger(HelloWorldTest.class.getName()).info("CountDown");
}
});
}
assertTrue(latch.await(10 * getAsyncTimeoutMultiplier(), TimeUnit.SECONDS));
boolean await = latch.await(10 * getAsyncTimeoutMultiplier(), TimeUnit.SECONDS);
final long toc = System.currentTimeMillis();
Logger.getLogger(HelloWorldTest.class.getName()).info("Executed in: " + (toc - tic));
Logger.getLogger(HelloWorldTest.class.getName()).info("Count is:" + latch.getCount());
assertTrue(await);

StringBuilder resultInfo = new StringBuilder("Results:\n");
for (int i = 0; i < REQUESTS; i++) {
Expand Down
15 changes: 0 additions & 15 deletions etc/jenkins/Jenkinsfile_ci_build
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,6 @@ pipeline {
stages {
stage('Jersey build') {
parallel {
stage('JDK 11') {
agent {
label 'centos-7'
}
tools {
jdk 'openjdk-jdk11-latest'
maven 'apache-maven-latest'
}
steps {
sh '''
bash ${WORKSPACE}/etc/jenkins/jenkins_build.sh
bash ${WORKSPACE}/etc/scripts/validation/dependency-convergence.sh
'''
}
}
stage('JDK 21') {
agent {
label 'centos-7'
Expand Down

0 comments on commit 65594e5

Please sign in to comment.