changeset 1036:692f56665b7a

SynchFlowWorker bugfix + minors
author Devel 2
date Tue, 07 Apr 2020 15:04:06 +0200
parents 46067bb4f3ce
children e62df9b84df7
files stress-tester/src/main/java/com/passus/st/client/FlowProcessor.java stress-tester/src/main/java/com/passus/st/client/FlowWorkerBase.java stress-tester/src/main/java/com/passus/st/client/SynchFlowWorker.java stress-tester/src/test/java/com/passus/st/client/AbstractFlowWorkerTest.java
diffstat 4 files changed, 2 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/FlowProcessor.java	Tue Apr 07 13:34:22 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/client/FlowProcessor.java	Tue Apr 07 15:04:06 2020 +0200
@@ -278,11 +278,9 @@
     @Override
     public void dataReceived(ChannelContext context, ByteBuff data) throws Exception {
         FlowContext flowContext = context.getFlowContext();
-        logger.debug("dataReceived");
         flowContext.lock();
         try {
             try {
-                logger.debug("dataReceived-after lock");
                 FlowHandler client = flowContext.client();
                 FlowHandlerDataDecoder decoder = client.getResponseDecoder(flowContext);
                 decoder.decode(data, flowContext);
--- a/stress-tester/src/main/java/com/passus/st/client/FlowWorkerBase.java	Tue Apr 07 13:34:22 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/client/FlowWorkerBase.java	Tue Apr 07 15:04:06 2020 +0200
@@ -491,11 +491,9 @@
     @Override
     public void dataReceived(ChannelContext context, ByteBuff data) throws Exception {
         FlowContext flowContext = context.getFlowContext();
-        logger.debug("dataReceived");
         flowContext.lock();
         try {
             try {
-                logger.debug("dataReceived-after lock");
                 FlowHandler client = flowContext.client();
                 FlowHandlerDataDecoder decoder = client.getResponseDecoder(flowContext);
                 decoder.decode(data, flowContext);
--- a/stress-tester/src/main/java/com/passus/st/client/SynchFlowWorker.java	Tue Apr 07 13:34:22 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/client/SynchFlowWorker.java	Tue Apr 07 15:04:06 2020 +0200
@@ -146,10 +146,6 @@
                 }
             }
         }
-
-        eventsQueue.clear();
-        sessions.clear();
-        working = false;
     }
 
     @Override
@@ -259,6 +255,7 @@
                 logger.debug("DataEnd received. Deactivation.");
             }
 
+            eventsQueue.clear();
             working = false;
         }
     }
--- a/stress-tester/src/test/java/com/passus/st/client/AbstractFlowWorkerTest.java	Tue Apr 07 13:34:22 2020 +0200
+++ b/stress-tester/src/test/java/com/passus/st/client/AbstractFlowWorkerTest.java	Tue Apr 07 15:04:06 2020 +0200
@@ -31,12 +31,7 @@
 
 public abstract class AbstractFlowWorkerTest {
 
-    static {
-        Log4jConfigurationFactory.enableFactory("trace");
-    }
-
-    //public static final long JOIN_TIMEOUT = 10_000;
-    public static final long JOIN_TIMEOUT = Long.MAX_VALUE;
+    public static final long JOIN_TIMEOUT = 5_000;
 
     protected final TestHttpClientListener listener = new TestHttpClientListener();