Websockets test is working great locally, but failed in production (ONLINE tomcat service)

Hello everyone,
I’m using Gatling version 2.2.5 (the company I work uses it, I can’t change the version because lots of tests are written for those older tests)

My problem is this:
While I running my test vs my local tomcat service, everything is working great my WebSockets are remain open and stable along with the test.
While I running it vs my ONLINE environment of tomcat service, from the Gatling side it looks like everything is fine, but in my ONLINE tomcat server I am getting Errors and the Websockets are closing:

Error #1:

15:08:37.092 [http-nio-9008-exec-1] ERROR c.n.s.w.p.n.w.mess.TextWebSocketHandlerImpl [] [] [] [customIdentifier] [12838238-92838383-38383-12933] Session transport error occurred, client info: [UserIdentification{userName=‘ptor.it_bsxbvfsng9@wfosaas.com’userUUID=‘12838238-92838383-38383-12933’, customIdentifier=’’, userIdentificationKey=‘12838238-92838383-38383-12933’, sessionIP=’[192.114.118.35, 192.114.128.35, 10.221.32.134]’}], websocket sessionId: [213f]
java.io.EOFException: null
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1289)
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1223)
at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:72)
at org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:171)
at org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:151)
at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:148)
at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:54)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

Error #2 (Web-socket closing error 1006) :

15:08:42.449 [http-nio-9008-exec-5] INFO c.n.s.w.p.n.w.mess.TextWebSocketHandlerImpl [] [] [] [customIdentifier] [11e88a91-a0e7-1570-b4d1-0242ac110003] Session closed, WS sessionId: [cf] closed by tcp connection event, client info: [UserIdentification{userName=‘mail_for_tests@wfostts.com’userUUID=‘12838238-92838383-38383-12933’, customIdentifier=’’, userIdentificationKey=‘12838238-92838383-38383-12933’, sessionIP=’[192.114.118.35, 192.114.128.35, 10.221.32.134]’}], close status: [CloseStatus[code=1006, reason=null]]

My test:
[ open WebSocket, send the authentication message, check I’m getting “CONNECTED” message and count the number of messages I’m getting from the server, and then wait until all the WS will be opened, and just then - randomly close and open more WS (to mimic production unexpectedly behavior) ]

The test is a bit complex and involves all of this code:


val agentsOf2000UsersTenantsScn: ScenarioBuilder = scenario("NSOpenWsAndGet30RecentNotifications" + getTenantSize(true) + " Agents")
  .exec(usageModel2000UsersTenantsFeeder.getModelfeeder(Roles.AGENTS))
  .doIf(session => session.contains(ExecConstants.tokenKey)) {
    exec(NotificationExecs.allExecs(requiredWS,percentageOfWSToClose,getTimeOfClosingAndOpeningWs))
  }

def allExecs(requiredWS: Int, percentageOfWSToClose : Double, timeForOpenAndCloseInSec : Int ) : ChainBuilder = {
  exec(openWS("0"))
    .exec(sendConnectMsg("0"))
    .exec(saveMsgsCounter)
    .exec(waitUntilThereAreEnoughWS(requiredWS))
    .exec(closeAndOpenRandomized(percentageOfWSToClose,timeForOpenAndCloseInSec))
    .exec(closeWS("0"))
}

Hello,

I’m afraid no one can help with such an old version.
Even I don’t remember how things used to work in Gatling 2.2.
Both Gatling 2 and Netty 4.0 have reached end-of-life a long time ago.
You should convince your company to upgrade, it’s like you’re using Windows NT: you’re bound to run into trouble.

Regards,

Thank you for your answer Stephane. Is there any elegant workaround, what do you think?

среда, 8 апреля 2020 г. в 11:51:19 UTC+3, Stéphane Landelle: