Skip to content

Commit

Permalink
Synchronize JeroMqAppender test methods
Browse files Browse the repository at this point in the history
The `sendRcFalse` and `sendRcTrue` fields of `JeroMqAppender` are accessed without the necessary synchronization, which causes some test failures.
  • Loading branch information
ppkarwasz committed Dec 9, 2024
1 parent 8ee4237 commit 551652a
Showing 1 changed file with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,22 +224,30 @@ public boolean stop(final long timeout, final TimeUnit timeUnit) {
return stopped;
}

// not public, handy for testing
int getSendRcFalse() {
/**
* Used in tests
*/
synchronized int getSendRcFalse() {
return sendRcFalse;
}

// not public, handy for testing
int getSendRcTrue() {
/**
* Used in tests
*/
synchronized int getSendRcTrue() {
return sendRcTrue;
}

// not public, handy for testing
void resetSendRcs() {
/**
* Used in tests
*/
synchronized void resetSendRcs() {
sendRcTrue = sendRcFalse = 0;
}

// not public, handy for testing
/**
* Used in tests
*/
JeroMqManager getManager() {
return manager;
}
Expand Down

0 comments on commit 551652a

Please sign in to comment.