Skip to content

Commit

Permalink
fix logger number not correct in tests (apache#12168)
Browse files Browse the repository at this point in the history
### Motivation

Log placehodlers not correct. Cause some log info is missing or `{}` alone

### Modifications

Fix the placeholder, add `{}` or delete `{}`
  • Loading branch information
ZhangJian He authored Sep 26, 2021
1 parent 1e133e9 commit a69611c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void testTlsLargeSizeMessage() throws Exception {
log.info("-- Starting {} test --", methodName);

final int MESSAGE_SIZE = 16 * 1024 + 1;
log.info("-- message size --", MESSAGE_SIZE);
log.info("-- message size {} --", MESSAGE_SIZE);

internalSetUpForClient(true, pulsar.getBrokerServiceUrlTls());
internalSetUpForNamespace();
Expand Down Expand Up @@ -77,7 +77,7 @@ public void testTlsClientAuthOverBinaryProtocol() throws Exception {
log.info("-- Starting {} test --", methodName);

final int MESSAGE_SIZE = 16 * 1024 + 1;
log.info("-- message size --", MESSAGE_SIZE);
log.info("-- message size {} --", MESSAGE_SIZE);
internalSetUpForNamespace();

// Test 1 - Using TLS on binary protocol without sending certs - expect failure
Expand All @@ -88,7 +88,7 @@ public void testTlsClientAuthOverBinaryProtocol() throws Exception {
Assert.fail("Server should have failed the TLS handshake since client didn't .");
} catch (Exception ex) {
// OK
log.info("first test success: without certs set, meet exception {}", ex);
log.info("first test success: without certs set, meet exception ", ex);
}

// Test 2 - Using TLS on binary protocol - sending certs
Expand All @@ -107,7 +107,7 @@ public void testTlsClientAuthOverHTTPProtocol() throws Exception {
log.info("-- Starting {} test --", methodName);

final int MESSAGE_SIZE = 16 * 1024 + 1;
log.info("-- message size --", MESSAGE_SIZE);
log.info("-- message size {} --", MESSAGE_SIZE);
internalSetUpForNamespace();

// Test 1 - Using TLS on https without sending certs - expect failure
Expand All @@ -118,7 +118,7 @@ public void testTlsClientAuthOverHTTPProtocol() throws Exception {
Assert.fail("Server should have failed the TLS handshake since client didn't .");
} catch (Exception ex) {
// OK
log.info("first test success: without certs set, meet exception {}", ex);
log.info("first test success: without certs set, meet exception ", ex);
}

// Test 2 - Using TLS on https - sending certs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ public void validatePoliciesReadOnlyAccess() {
throw new RestException(Status.FORBIDDEN, "Broker is forbidden to do read-write operations");
}
} catch (Exception e) {
log.warn("Unable to fetch read-only policy config {}", e);
log.warn("Unable to fetch read-only policy config ", e);
throw new RestException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public void testBulkBlocking() throws Exception {
long start = System.currentTimeMillis();
for (int i = 6; i <= 15; i++) {
client.bulkIndex(mockRecord, Pair.of(Integer.toString(i), "{\"a\":" + i + "}"));
log.info("{} index [}", System.currentTimeMillis(), i);
log.info("{} index {}", System.currentTimeMillis(), i);
}
long elapsed = System.currentTimeMillis() - start;
log.info("elapsed = {}", elapsed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ public void dumpFunctionLogs(String name) {
});
log.info("Function {} logs {}", name, logs);
} catch (com.github.dockerjava.api.exception.NotFoundException notFound) {
log.info("Cannot download {} logs from {}", name, container.getContainerName(), notFound.toString());
log.info("Cannot download {} logs from {} not found exception {}", name, container.getContainerName(), notFound.toString());
} catch (Throwable err) {
log.info("Cannot download {} logs from {}", name, container.getContainerName(), err);
}
Expand Down

0 comments on commit a69611c

Please sign in to comment.