Conversation
…or unexpected number of events case
labkey-tchad
left a comment
There was a problem hiding this comment.
I think your hunch might be correct. Even if it isn't in this case, the fact that it's possible that it might be indicates that this probably isn't a reliable way to perform this check.
It might be prudent to change how the check works at a more fundamental level. This method should take a runnable that triggers the event that is expected to be audited. That way it can know the previous state and wait for a change after triggering the event instead of assuming that the event has already completed. Something like:
checkAuditEventDiffCountForLastTransaction(/*existing params*/, Runnable runnable)
{
Integer initialTransactionId = getLastTransactionId(containerPath, auditEventName);
runnable.run();
// Wait for transaction with id > initialTransactionId and verify counts
}
|
@labkey-tchad I like your idea of adding a Runnable and checking / waiting for the new transactionId to show up in the audit event before checking. I'm going to get this small change merged and then we can look into using the |
Rationale
The SMProMoveAliquotTest.testMoveAliquotToParentProject test intermittent failure indicates that it is getting 3 audit events for the last transactionId when it only expects 2. I have a hunch that it is looking at the wrong transaction events. This PR adds some logging in this failure case.
Changes