]> git.ipfire.org Git - thirdparty/asterisk.git/commit
main/test: Fix race condition between AMI topic and Test Suite topic
authorMatthew Jordan <mjordan@digium.com>
Thu, 4 Dec 2014 15:47:44 +0000 (15:47 +0000)
committerMatthew Jordan <mjordan@digium.com>
Thu, 4 Dec 2014 15:47:44 +0000 (15:47 +0000)
commitffe1c85136911f439911f69100af887babba44aa
tree3e3e7fe30cafbb963e790ed32ca6c61e19c048cf
parentd46555f1d6a26ec014591ba3d2f482b7c0f3494f
main/test: Fix race condition between AMI topic and Test Suite topic

This patch fixes a race condition between the raising of test AMI events (which
drive many tests in the Asterisk Test Suite) and other AMI events. Prior to
this patch, the Stasis messages published to the test topic were not forwarded
to the AMI topic. Instead, the code in manager had a dedicated handler for test
messages that was independent of the topics forwarded to the AMI topic. This
results in no synchronization between the test messages and the rest of the
Stasis messages published out over AMI. In some test with very tight timing
constraints, this can result in out of order messages and spurious test
failures. Properly forwarding the Test Suite topic to the AMI topic ensures
that the messages are synchronized properly.

This patch does that, and moves the message handling to the Stasis definition
of the Test Suite message in test.c as well.

Review: https://reviewboard.asterisk.org/r/4221/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@428945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/manager.c
main/test.c