Skip to content

Commit

Permalink
TestEnvironment: Fix timeout arithmetic
Browse files Browse the repository at this point in the history
Motivation:
The timeout calculation decrementing `totalTimeoutRemainingNs` is incorrect
which results in premature timeouts and test failures.
  • Loading branch information
Scottmitch committed Mar 7, 2023
1 parent 944163a commit 5c39a4f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ final <E extends Throwable> E expectError(Class<E> clazz, final long totalTimeou

if (env.asyncErrors.isEmpty()) {
timeStampBNs = System.nanoTime();
totalTimeoutRemainingNs =- timeStampBNs - timeStampANs;
totalTimeoutRemainingNs -= (timeStampBNs - timeStampANs);
timeStampANs = timeStampBNs;

if (totalTimeoutRemainingNs <= 0) {
Expand Down

0 comments on commit 5c39a4f

Please sign in to comment.