Skip to content

Commit 372e058

Browse files
authored
Merge branch 'main' into test-latest-deps-helper
2 parents 41932a2 + bc6e193 commit 372e058

43 files changed

Lines changed: 554 additions & 314 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/agents/knowledge/testing-general-patterns.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@
3737
wrapping when the lambda already needs its own error handling for behavioral reasons.
3838
- Do **not** choose `CompletableFuture.runAsync(...)` over the simpler
3939
`executor.submit(runnable).get()` just to avoid the checked exceptions thrown by `Future.get()`.
40+
- Do **not** wrap a call in `assertThatCode(() -> ...).doesNotThrowAnyException()`
41+
solely to narrow a test method's `throws` clause by swallowing checked exceptions
42+
into an `AssertionError`. If the call throws, the test already fails via its
43+
`throws` clause. Prefer calling the method directly and leaving `throws Exception`
44+
(or the narrowest checked type) on the `@Test` method.
4045

4146
## Test Resource Cleanup
4247

.github/scripts/rerun-flaky-pr-jobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from pathlib import Path
1717

1818
LOOKBACK_HOURS = 2
19-
MAX_FAILED_JOBS_PER_WORKFLOW_RUN = 2
19+
MAX_FAILED_JOBS_PER_WORKFLOW_RUN = 5
2020
MAX_RERUN_ATTEMPTS = 2
2121

2222

@@ -36,7 +36,7 @@ def main() -> None:
3636
continue
3737

3838
rerun_attempts = run["run_attempt"] - 1
39-
if rerun_attempts > MAX_RERUN_ATTEMPTS:
39+
if rerun_attempts >= MAX_RERUN_ATTEMPTS:
4040
processed_runs.append(
4141
f"Skipped {format_run(run)}: already rerun {rerun_attempts} times."
4242
)

.github/workflows/code-review-sweep.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
outputs:
2626
modules: ${{ steps.build-matrix.outputs.modules }}
2727
has_work: ${{ steps.build-matrix.outputs.has_work }}
28+
model: ${{ steps.model.outputs.model }}
2829
steps:
2930
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3031
with:
@@ -33,6 +34,12 @@ jobs:
3334
- name: Fetch progress branch
3435
run: git fetch origin otelbot/code-review-progress || true
3536

37+
- name: Resolve Copilot model
38+
id: model
39+
run: |
40+
model=$(git show origin/otelbot/code-review-progress:model.txt | xargs)
41+
echo "model=$model" >> "$GITHUB_OUTPUT"
42+
3643
- name: Build review matrix
3744
id: build-matrix
3845
env:
@@ -58,7 +65,7 @@ jobs:
5865
contents: write # for git push
5966
env:
6067
MODULES_JSON: ${{ needs.dispatch.outputs.modules }}
61-
MODEL: "gpt-5.4"
68+
MODEL: ${{ needs.dispatch.outputs.model }}
6269
# Stop processing further modules once at least this many files have been
6370
# modified (vs origin/main) at the end of a module.
6471
FILE_THRESHOLD: 10

docs/instrumentation-list.yaml

Lines changed: 379 additions & 146 deletions
Large diffs are not rendered by default.

instrumentation/elasticsearch/elasticsearch-transport-6.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/v6_0/AbstractElasticsearch6NodeClientTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.elasticsearch.client.Client;
1616
import org.elasticsearch.common.settings.Settings;
1717
import org.elasticsearch.node.Node;
18-
import org.junit.jupiter.api.AfterAll;
1918
import org.junit.jupiter.api.BeforeAll;
2019
import org.junit.jupiter.api.Test;
2120
import org.junit.jupiter.api.io.TempDir;
@@ -45,6 +44,7 @@ void setUp(@TempDir File esWorkingDir) {
4544
.put("discovery.type", "single-node")
4645
.build();
4746
testNode = getNodeFactory().newNode(settings);
47+
cleanup.deferAfterAll(testNode);
4848
startNode(testNode);
4949

5050
client = testNode.client();
@@ -75,11 +75,6 @@ void setUp(@TempDir File esWorkingDir) {
7575
testing.clearData();
7676
}
7777

78-
@AfterAll
79-
void cleanUp() throws Exception {
80-
testNode.close();
81-
}
82-
8378
protected abstract NodeFactory getNodeFactory();
8479

8580
@Override

instrumentation/elasticsearch/elasticsearch-transport-6.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/elasticsearch/transport/v6_0/AbstractElasticsearch6TransportClientTest.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.elasticsearch.node.Node;
2020
import org.elasticsearch.transport.TransportService;
2121
import org.elasticsearch.transport.client.PreBuiltTransportClient;
22-
import org.junit.jupiter.api.AfterAll;
2322
import org.junit.jupiter.api.BeforeAll;
2423
import org.junit.jupiter.api.io.TempDir;
2524
import org.slf4j.Logger;
@@ -46,6 +45,7 @@ void setUp(@TempDir File esWorkingDir) {
4645
.put("discovery.type", "single-node")
4746
.build();
4847
testNode = getNodeFactory().newNode(settings);
48+
cleanup.deferAfterAll(testNode);
4949
startNode(testNode);
5050

5151
tcpPublishAddress =
@@ -59,6 +59,7 @@ void setUp(@TempDir File esWorkingDir) {
5959
.put("thread_pool.listener.size", 1)
6060
.put(CLUSTER_NAME_SETTING.getKey(), clusterName)
6161
.build());
62+
cleanup.deferAfterAll(client);
6263
client.addTransportAddress(tcpPublishAddress);
6364
testing.runWithSpan(
6465
"setup",
@@ -88,12 +89,6 @@ void setUp(@TempDir File esWorkingDir) {
8889
testing.clearData();
8990
}
9091

91-
@AfterAll
92-
void cleanUp() throws Exception {
93-
client.close();
94-
testNode.close();
95-
}
96-
9792
protected abstract NodeFactory getNodeFactory();
9893

9994
@Override

instrumentation/executors/bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/executors/PropagatedContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public final class PropagatedContext {
2222

2323
// Used by AtomicReferenceFieldUpdater
2424
@SuppressWarnings("UnusedVariable")
25+
@Nullable
2526
private volatile Context context;
2627

2728
PropagatedContext() {}

instrumentation/executors/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/executors/CallableInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public ElementMatcher<TypeDescription> typeMatcher() {
3232
public void transform(TypeTransformer transformer) {
3333
transformer.applyAdviceToMethod(
3434
named("call").and(takesArguments(0)).and(isPublic()),
35-
CallableInstrumentation.class.getName() + "$CallableAdvice");
35+
getClass().getName() + "$CallableAdvice");
3636
}
3737

3838
@SuppressWarnings("unused")

instrumentation/executors/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/executors/FutureInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public boolean matches(TypeDescription target) {
9292
public void transform(TypeTransformer transformer) {
9393
transformer.applyAdviceToMethod(
9494
named("cancel").and(returns(boolean.class)),
95-
FutureInstrumentation.class.getName() + "$CanceledFutureAdvice");
95+
getClass().getName() + "$CanceledFutureAdvice");
9696
}
9797

9898
@SuppressWarnings("unused")

instrumentation/executors/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/executors/JavaExecutorInstrumentation.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,45 +53,44 @@ public ElementMatcher<TypeDescription> typeMatcher() {
5353
public void transform(TypeTransformer transformer) {
5454
transformer.applyAdviceToMethod(
5555
named("execute").and(takesArgument(0, Runnable.class)).and(takesArguments(1)),
56-
JavaExecutorInstrumentation.class.getName() + "$SetExecuteRunnableStateAdvice");
56+
getClass().getName() + "$SetExecuteRunnableStateAdvice");
5757
// Netty uses addTask as the actual core of their submission; there are non-standard variations
5858
// like execute(Runnable,boolean) that aren't caught by standard instrumentation
5959
transformer.applyAdviceToMethod(
6060
named("addTask").and(takesArgument(0, Runnable.class)).and(takesArguments(1)),
61-
JavaExecutorInstrumentation.class.getName() + "$SetExecuteRunnableStateAdvice");
61+
getClass().getName() + "$SetExecuteRunnableStateAdvice");
6262
transformer.applyAdviceToMethod(
6363
named("execute").and(takesArgument(0, ForkJoinTask.class)),
64-
JavaExecutorInstrumentation.class.getName() + "$SetJavaForkJoinStateAdvice");
64+
getClass().getName() + "$SetJavaForkJoinStateAdvice");
6565
transformer.applyAdviceToMethod(
6666
named("submit")
6767
.and(takesArgument(0, Runnable.class))
6868
.and(returns(hasSuperType(is(Future.class)))),
69-
JavaExecutorInstrumentation.class.getName() + "$SetSubmitRunnableStateAdvice");
69+
getClass().getName() + "$SetSubmitRunnableStateAdvice");
7070
transformer.applyAdviceToMethod(
7171
named("submit")
7272
.and(takesArgument(0, Callable.class))
7373
.and(returns(hasSuperType(is(Future.class)))),
74-
JavaExecutorInstrumentation.class.getName() + "$SetCallableStateAdvice");
74+
getClass().getName() + "$SetCallableStateAdvice");
7575
transformer.applyAdviceToMethod(
7676
named("submit").and(takesArgument(0, ForkJoinTask.class)),
77-
JavaExecutorInstrumentation.class.getName() + "$SetJavaForkJoinStateAdvice");
77+
getClass().getName() + "$SetJavaForkJoinStateAdvice");
7878
transformer.applyAdviceToMethod(
7979
namedOneOf("invokeAny", "invokeAll").and(takesArgument(0, Collection.class)),
80-
JavaExecutorInstrumentation.class.getName()
81-
+ "$SetCallableStateForCallableCollectionAdvice");
80+
getClass().getName() + "$SetCallableStateForCallableCollectionAdvice");
8281
transformer.applyAdviceToMethod(
8382
named("invoke").and(takesArgument(0, ForkJoinTask.class)),
84-
JavaExecutorInstrumentation.class.getName() + "$SetJavaForkJoinStateAdvice");
83+
getClass().getName() + "$SetJavaForkJoinStateAdvice");
8584
transformer.applyAdviceToMethod(
8685
named("schedule")
8786
.and(takesArgument(0, Runnable.class))
8887
.and(returns(hasSuperType(is(Future.class)))),
89-
JavaExecutorInstrumentation.class.getName() + "$SetSubmitRunnableStateAdvice");
88+
getClass().getName() + "$SetSubmitRunnableStateAdvice");
9089
transformer.applyAdviceToMethod(
9190
named("schedule")
9291
.and(takesArgument(0, Callable.class))
9392
.and(returns(hasSuperType(is(Future.class)))),
94-
JavaExecutorInstrumentation.class.getName() + "$SetCallableStateAdvice");
93+
getClass().getName() + "$SetCallableStateAdvice");
9594
}
9695

9796
@SuppressWarnings("unused")

0 commit comments

Comments
 (0)