Open emcell opened 1 week ago
I've made a pairing session with a colleague and I think we found a solution. I've opened a pull request.
@emcell, Could you please write a test case for this as well?
Hi @MaryamJalil,
I tried to write a test case, but failed. I'm really not used to write code in non typescript projects and I've never used sinon before.
I couldn't figure out how I can install a sinon spy on modbusClientNode.coreModbusQueue.sendQueueDataToModbus
since coreModbusQueue
is not part of the modbusClientNode
. I've seen that you created stubs for coreModbusQueue in other tests. But I'm pretty sure that they're not called in those tests either. In fact, I've added an assert on the stub of this test should handle error without a message in modbusSerialErrorHandling and log JSON stringified error
and it hasn't been called.
I have no other ideas how to test my bugfix. Can you point me into the right direction?
Which node-red-contrib-modbus version are you using?
5.25.0, 5.31.0, 5.40.0
What happened?
Modbus-Flex-Getter stops sending requests to modbus server after a specific set of messages
Server
Other/External server
How can this be reproduced?
I've figured out that this happens when you add 3 modbus-requests to the queue at the same time. The Problem happens after a request that times out.
After that every modbus-request will just be added to the queue. But no request will be sent out.
my testing flow:
I've tested against a real modbus-tcp server. But it's also possible to reproduce this with a simple socat command
clear text modbus-request i'm using
I've tried to debug all this an found out that request 2 is going out and the state machine immedately (it does not wait until the response from request 2 is incoming) tries to send request 3. I tried to fix this ans make a pull request But I couldn't figure out how. Everything I've tried just made things worse ...
What did you expect to happen?
Other Information