Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excavator: Upgrades Baseline to the latest version #306

Merged
merged 1 commit into from
Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .baseline/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,13 @@
<module name="AvoidStarImport"/> <!-- Java Style Guide: No wildcard imports -->
<module name="AvoidStaticImport"> <!-- Java Style Guide: No static imports -->
<property name="excludes" value="
com.google.common.base.Preconditions.*,
com.palantir.logsafe.Preconditions.*,
java.util.Collections.*,
java.util.stream.Collectors.*,
com.palantir.logsafe.Preconditions.*,
com.google.common.base.Preconditions.*,
org.apache.commons.lang3.Validate.*"/>
org.apache.commons.lang3.Validate.*,
org.assertj.core.api.Assertions.*,
org.mockito.Mockito.*"/>
</module>
<module name="ClassTypeParameterName"> <!-- Java Style Guide: Type variable names -->
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ buildscript {
classpath 'com.github.jengelman.gradle.plugins:shadow:5.1.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.netflix.nebula:nebula-publishing-plugin:14.0.0'
classpath 'com.palantir.baseline:gradle-baseline-java:2.10.1'
classpath 'com.palantir.baseline:gradle-baseline-java:2.19.0'
classpath 'com.palantir.gradle.gitversion:gradle-git-version:0.12.2'
classpath 'gradle.plugin.org.inferred:gradle-processors:3.1.0'
classpath 'com.palantir.gradle.consistentversions:gradle-consistent-versions:1.12.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void handles_async_spans() throws Exception {
Tracer.clearCurrentTrace(); // just pretending all these tasks are on a fresh request

DetachedSpan crossThread = DetachedSpan.start("task-queue-time" + i);
executorService.submit(() -> {
executorService.execute(() -> {
try (CloseableSpan t = crossThread.completeAndStartChild("task" + i)) {
emit_nested_spans();
countDownLatch.countDown();
Expand Down Expand Up @@ -97,7 +97,7 @@ public void onFailure(Throwable _throwable) {
});

try (CloseableTracer root = CloseableTracer.startSpan("bbb")) {
executorService.submit(() -> {
executorService.execute(() -> {
future.set(null);
});
}
Expand All @@ -124,7 +124,7 @@ void multi_producer_single_consumer() throws InterruptedException {
Tracer.clearCurrentTrace(); // just pretending all these tasks are on a fresh request

DetachedSpan span = DetachedSpan.start("callback-pending" + i + " (cross thread span)");
producerExecutorService.submit(() -> {
producerExecutorService.execute(() -> {
work.add(new QueuedWork() {
@Override
public String name() {
Expand Down Expand Up @@ -219,7 +219,7 @@ public void onFailure(Throwable _throwable) {
}
}, executor);

executor.submit(() -> {
executor.execute(() -> {
future.set(null);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void handles_async_spans() throws Exception {
IntStream.range(0, numTasks).forEach(i -> {
DetachedSpan detachedSpan = DetachedSpan.start("task-queue-time" + i);

executorService.submit(() -> {
executorService.execute(() -> {
try (CloseableSpan closeableSpan = detachedSpan.completeAndStartChild("do-work-" + i)) {
prod_code();
countDownLatch.countDown();
Expand Down
8 changes: 4 additions & 4 deletions tracing/src/test/java/com/palantir/tracing/TracerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void testTraceCopyIsIndependent() throws Exception {
} finally {
Tracer.fastCompleteSpan();
}
assertThat(Tracer.completeSpan().isPresent()).isFalse();
assertThat(Tracer.completeSpan()).isNotPresent();
}

@Test
Expand Down Expand Up @@ -250,13 +250,13 @@ public void testCompleteSpanWithMetadataIncludesMetadata() {
"key2", "value2");
Tracer.fastStartSpan("operation");
Optional<Span> maybeSpan = Tracer.completeSpan(metadata);
assertThat(maybeSpan.isPresent()).isTrue();
assertThat(maybeSpan).isPresent();
assertThat(maybeSpan.get().getMetadata()).isEqualTo(metadata);
}

@Test
public void testCompleteSpanWithoutMetadataHasNoMetadata() {
assertThat(startAndCompleteSpan().getMetadata().isEmpty()).isTrue();
assertThat(startAndCompleteSpan().getMetadata()).isEmpty();
}

@Test
Expand Down Expand Up @@ -339,7 +339,7 @@ public void testCompleteRootSpanCompletesTrace() {
} finally {
Tracer.unsubscribe("traceIds");
}
assertThat(traceIds.size()).isEqualTo(2);
assertThat(traceIds).hasSize(2);
}

@Test
Expand Down
4 changes: 2 additions & 2 deletions tracing/src/test/java/com/palantir/tracing/TracersTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ private static Callable<Void> traceExpectingCallableWithSingleSpan(String operat
String traceId = Tracer.getTraceId();
List<OpenSpan> trace = getCurrentTrace();
OpenSpan span = trace.remove(trace.size() - 1);
assertThat(trace.size()).isEqualTo(0);
assertThat(trace).hasSize(0);

assertThat(traceId).isEqualTo(outsideTraceId);
assertThat(span.getOperation()).isEqualTo(operation);
Expand All @@ -619,7 +619,7 @@ private static Runnable traceExpectingRunnableWithSingleSpan(String operation) {
String traceId = Tracer.getTraceId();
List<OpenSpan> trace = getCurrentTrace();
OpenSpan span = trace.remove(trace.size() - 1);
assertThat(trace.size()).isEqualTo(0);
assertThat(trace).hasSize(0);

assertThat(traceId).isEqualTo(outsideTraceId);
assertThat(span.getOperation()).isEqualTo(operation);
Expand Down