Skip to content

Commit

Permalink
Add signal/wait model for TestAuditlogImpl (#1758)
Browse files Browse the repository at this point in the history
* Add signal/wait model for TestAuditlogImpl

I have been tracking test failures with testRestMethod very often
showing failures.  My theory is that the execution environment can
impact the order of operations sometimes causing the audit log not to
contain messages before it is checked.

Adding a new method `doThenWaitForMessages(...)` this ensures the
log queue is fresh, the triggering action completes, and the expected
number of messages were recieved.  There is a second long time window
that allows for the messages to be flushed, this is likely more than
enough - if the messages are recieved the count down latch immediately
continues execution so the tests will not wait if they are ready to
proceed.

While this new method is much more reliable not all tests were
encountering such issues, so I've keep the original convention.  This
can be migrated in one-offs or all at once if we see more troublesome
behavoir.  The previous methods/fields are depreciated to push future
tests to follow the new pattern.

Modifications to the rest helper not to throw exceptions were needed to
keep the Runnable declaration clean and small.

Signed-off-by: Peter Nied <[email protected]>
(cherry picked from commit e213e9c)
  • Loading branch information
peternied committed Apr 26, 2022
1 parent 3a873f8 commit 3db10a1
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 3db10a1

Please sign in to comment.