eclipse-sparkplug / sparkplug

Sparkplug
Eclipse Public License 2.0
109 stars 39 forks source link

Bug Report: TCK Primary Host Test does not account for bdSeq #502

Open marcellorinaldo opened 7 months ago

marcellorinaldo commented 7 months ago

What happened?

The Primary Host Test suite can fail incorrectly at:

message-flow-edge-node-birth-publish-phid-offline: FAIL [tck-id-message-flow-edge-node-birth-publish-phid-offline] If the Edge Node is configured to wait for a Primary Host Application, it is connected to the MQTT Server, and receives a STATE message on its configured Primary Host, the timestamp value in the payload is greater than or equal to the timestamp value included in the prior 'online' STATE message, and the 'online' value is false, it MUST immediately publish an NDEATH message and disconnect from the MQTT Server and start the connection establishment process over. (org.eclipse.sparkplug.tck.test.edge.PrimaryHostTest.publish(PrimaryHostTest.java:475))

The test PrimaryHostTest verifies only that a NDEATH message is not received after having sent a STATE message for a wrong host. It should not fail if the NDEATH message is related to a previous valid offline STATE message (maybe due to delays in the network). The check should be more consistent and actually verify the bdSeq.

What is the product or software this issue was discovered with?

Sparkplug TCK, verified on master branch.

What exact steps need to be performed to reproduce the problem?

  1. Create an Edge Node that introduces a 3 seconds delay for sending NDEATH
  2. Run tests in 'Primary Host Test' section

Is this related to a Sparkplug Listing request? If so, link the issue from https://github.com/eclipse-sparkplug/sparkplug.listings here.

No response

Version

3.0.0 (Default)

Accept EFTL Terms