Skip to content

Commit

Permalink
test: do not show unnecessary BatcherImplTest logging (#2519)
Browse files Browse the repository at this point in the history
This is the follow-up of a pull request #2285, where we wanted to
catch any flaky test failure with logging, just in case the test
failed again.

https://github.com/googleapis/sdk-platform-java/pull/2285/files#r1416300479

It turned out that the fix worked well. We don't observe the test
failures any more. Therefore turning off the excessive logging.
  • Loading branch information
suztomo committed Feb 28, 2024
1 parent 7c09e23 commit c8d145b
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ public void testThrottlingBlocking() throws Exception {
public void run() {
batcherAddThreadHolder.add(Thread.currentThread());
batcher.add(1);
logger.info("Called batcher.add(1)");
logger.fine("Called batcher.add(1)");
}
});

Expand All @@ -893,20 +893,20 @@ public void run() {
() -> {
try {
Thread.sleep(throttledTime);
logger.info("Calling flowController.release");
logger.fine("Calling flowController.release");
flowController.release(1, 1);
logger.info("Called flowController.release");
logger.fine("Called flowController.release");
} catch (InterruptedException e) {
}
});

try {
logger.info("Calling future.get(10 ms)");
logger.fine("Calling future.get(10 ms)");
future.get(10, TimeUnit.MILLISECONDS);
long afterGetCall = System.currentTimeMillis();
long actualWaitTimeMs = afterGetCall - beforeGetCall;

logger.info("future.get(10 ms) unexpectedly returned. Wait time: " + actualWaitTimeMs);
logger.fine("future.get(10 ms) unexpectedly returned. Wait time: " + actualWaitTimeMs);
// In a flaky test troubleshooting
// (https://github.com/googleapis/sdk-platform-java/issues/1931), we observed that
// "future.get" method did not throw TimeoutException in this multithreaded test.
Expand All @@ -919,7 +919,7 @@ public void run() {
.isAtLeast(10);
} catch (TimeoutException e) {
// expected
logger.info("future.get(10 ms) timed out expectedly.");
logger.fine("future.get(10 ms) timed out expectedly.");
}

try {
Expand Down

0 comments on commit c8d145b

Please sign in to comment.