Skip to content

Test SPAT Message Count Progression

Ivan Yourshaw edited this page Jan 31, 2025 · 5 revisions

Integration Test for SPAT Message Count Progression

Note: SPAT Message Count Progression Events can be configured to enable aggregation using the spat.message.count.progression.aggregateEvents configuration setting, or the ENABLE_AGGREGATE_SPAT_MESSAGE_COUNT_PROGRESSION environment variable. If aggregation is enabled, events will be delayed by up to the configured aggregation.interval, which is 60 seconds by default.

Inputs

A series of processed SPAT Messages:

  1. A baseline SPAT.
  2. 1 second later, a changed SPAT with an incremented message count.
  3. 200 ms later, a changed SPAT with the same message count. This generates an event, because the change should have led to a message count increment.
  4. 200 ms later, a changed SPAT with a message count increased by 10. This generates an event, because the message count should have only increased by 1.
  5. 200 ms later, a changed SPAT with an incremented message count.
  6. 200 ms later, a changed SPAT with an incremented message count that wraps around from 127 to 0. This does not generate an event.
  7. 3 seconds later, a changed SPAT with a message count increased by 10. This does not generate an event, because the different message appears outside the maximum time window of 500 ms.
  8. 200 ms later, a changed SPAT with an incremented message count.

Test Script

ProcessedSpat_Revisions.csv

Output Kafka Topics

If aggregation is enabled, events are output to:

  • topic.CmMapMessageCountProgressionEventAggregation

If aggregation is disabled, events are output to:

  • topic.CmSpatMessageCountProgressionEvents

With Aggregation

Expected Output

Two SpatMessageCountProgressionEvents produced on the topic within 30 seconds.

Actual Output

Topic: topic.CmSpatMessageCountProgressionEvents

% Waiting for group rebalance
% Group group rebalanced (memberid rdkafka-19a51496-0d57-436a-b9aa-912e41cdc247): assigned: topic.CmSpatRevisionCounterEvents [0]
% Reached end of topic topic.CmSpatRevisionCounterEvents [0] at offset 0
{"eventGeneratedAt":1731693087687,"eventType":"SpatMessageCountProgression","intersectionID":0,"roadRegulatorID":0,"messageType":"SPaT","messageCountA":116,"timestampA":"2024-11-15T17:51:27.258Z[UTC]","messageCountB":116,"timestampB":"2024-11-15T17:51:27.458Z[UTC]"}
{"eventGeneratedAt":1731693087887,"eventType":"SpatMessageCountProgression","intersectionID":0,"roadRegulatorID":0,"messageType":"SPaT","messageCountA":116,"timestampA":"2024-11-15T17:51:27.458Z[UTC]","messageCountB":126,"timestampB":"2024-11-15T17:51:27.658Z[UTC]"}
% Reached end of topic topic.CmSpatMessageCountProgressionEvents [0] at offset 2

Comments

If the SPAT messages for this intersection has been sent prior to this test, the result may differ from the above.

Without Aggregation

TODO

Clone this wiki locally