SNEWS2 / SNEWS_Coincidence_System

Coincidence System backend for snews alert trigger
BSD 2-Clause "Simplified" License
1 stars 2 forks source link

Internal testing logic #124

Closed KaraMelih closed 2 months ago

KaraMelih commented 2 months ago

I added a second cache called test_coinc_cache and a second alert publisher which is set to publish alerts to the "test connection topic" and not the main alert topic.

Except for long term storage both instances and publications are doing the same things.

Once a message in the stream is read. The contents are first searched by the command handler, which returns True if the message is indeed a coincidence tier message. (if not, check if it is a known command, or significance tier or etc. and returns False)

The new part starts here. If the message is sent with a is_test=True flag, coincidence decider starts using the test cache and runs the coincidence search with this cache. The main cache still remains but it is not used at this time. If a coincidence is found for this test cache, then it calls the alert publisher which publishes the alerts to the test connection topic.

KaraMelih commented 2 months ago

snews_pt should also be adjusted to subscribe to this topic to expect test alerts.

KaraMelih commented 2 months ago

On the PT side, it should work together with this branch

https://github.com/SNEWS2/SNEWS_Publishing_Tools/tree/testing_logic