Skip to content
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
1 change: 1 addition & 0 deletions .claude/skills/migrate-groovy-to-java/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ When converting Groovy code to Java code, make sure that:
- `@TableTest` and `@MethodSource` may be combined on the same `@ParameterizedTest` when most cases are tabular but a few cases require programmatic setup.
- In combined mode, keep table-friendly cases in `@TableTest`, and put only non-tabular/complex cases in `@MethodSource`.
- If `@TableTest` is not viable for the test at all, use `@MethodSource` only.
- If `@TableTest` was successfully used and if the `@ParameterizedTest` is not used to specify the test name, `@ParameterizedTest` can then be removed as `@TableTest` replace it fully.
- For `@MethodSource`, name the arguments method `<testMethodName>Arguments` (camelCase, e.g. `testMethodArguments`) and return `Stream<Arguments>` using `Stream.of(...)` and `arguments(...)` with static import.
- Ensure parameterized test names are human-readable (i.e. no hashcodes); instead add a description string as the first `Arguments.arguments(...)` value or index the test case
- When converting tuples, create a light dedicated structure instead to keep the typing system
Expand Down
1 change: 1 addition & 0 deletions dd-trace-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ dependencies {
testImplementation group: 'com.amazonaws', name: 'aws-lambda-java-events', version:'3.11.0'
testImplementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.14.0'
testImplementation libs.testcontainers
testImplementation project(':utils:junit-utils')

traceAgentTestImplementation libs.testcontainers
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,14 @@ private void flushStats() {
write = 0;
expired = 0;
}

// @VisibleForTesting
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we should import the real anno?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that having a proper annotation should be suitable, but I wonder if we should create our own... Otherwise we depend on one of these deps:

image

int trackedCount() {
return traceArray.size();
}

// @VisibleForTesting
int getDropped() {
return dropped;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,16 @@ boolean compareAndSetLongRunningState(int expected, int newState) {
return LONG_RUNNING_STATE.compareAndSet(this, expected, newState);
}

// @VisibleForTesting
int getLongRunningTrackedState() {
return longRunningTrackedState;
}

// @VisibleForTesting
void setLongRunningTrackedState(int state) {
LONG_RUNNING_STATE.set(this, state);
}

boolean empty() {
return 0 >= COMPLETED_SPAN_COUNT.get(this) + PENDING_REFERENCE_COUNT.get(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public interface Element {
boolean writeOnBufferFull();
}

private static class DelayingPendingTraceBuffer extends PendingTraceBuffer {
static class DelayingPendingTraceBuffer extends PendingTraceBuffer {
private static final long FORCE_SEND_DELAY_MS = TimeUnit.SECONDS.toMillis(5);
private static final long SEND_DELAY_NS = TimeUnit.MILLISECONDS.toNanos(500);
private static final long SLEEP_TIME_MS = 100;
Expand Down Expand Up @@ -303,6 +303,11 @@ public DelayingPendingTraceBuffer(
config, bufferSize, sharedCommunicationObjects, healthMetrics)
: null;
}

// @VisibleForTesting
LongRunningTracesTracker getRunningTracesTracker() {
return runningTracesTracker;
}
}

static class DiscardingPendingTraceBuffer extends PendingTraceBuffer {
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading