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

React to Tracer changes in TransportService from core#9415 #1034

Merged
merged 1 commit into from
Sep 11, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.opensearch.index.get.GetResult;
import org.opensearch.jobscheduler.spi.schedule.IntervalSchedule;
import org.opensearch.tasks.Task;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.timeseries.AbstractTimeSeriesTest;
import org.opensearch.timeseries.TestHelpers;
import org.opensearch.timeseries.constant.CommonName;
Expand Down Expand Up @@ -99,7 +100,8 @@ public void setUp() throws Exception {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
x -> null,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
);

client = mock(Client.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.opensearch.core.transport.TransportResponse;
import org.opensearch.core.xcontent.ToXContent;
import org.opensearch.tasks.Task;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.timeseries.AbstractTimeSeriesTest;
import org.opensearch.timeseries.TestHelpers;
import org.opensearch.timeseries.common.exception.TimeSeriesException;
Expand Down Expand Up @@ -125,7 +126,8 @@ public void setUp() throws Exception {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
x -> null,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
);
settings = Settings.EMPTY;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.opensearch.core.action.ActionListener;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.index.get.GetResult;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.timeseries.AbstractTimeSeriesTest;
import org.opensearch.timeseries.NodeStateManager;
import org.opensearch.timeseries.constant.CommonMessages;
Expand Down Expand Up @@ -103,7 +104,8 @@ public void setUp() throws Exception {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
x -> null,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
);

nodeFilter = mock(DiscoveryNodeFilterer.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.opensearch.core.transport.TransportResponse;
import org.opensearch.core.xcontent.ToXContent;
import org.opensearch.tasks.Task;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.timeseries.AbstractTimeSeriesTest;
import org.opensearch.timeseries.TestHelpers;
import org.opensearch.timeseries.common.exception.TimeSeriesException;
Expand Down Expand Up @@ -112,7 +113,8 @@ public void setUp() throws Exception {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
x -> null,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
);
future = new PlainActionFuture<>();

Expand Down
13 changes: 9 additions & 4 deletions src/test/java/org/opensearch/ad/transport/RCFResultTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.opensearch.core.xcontent.ToXContent;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.tasks.Task;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.timeseries.breaker.CircuitBreakerService;
import org.opensearch.timeseries.common.exception.LimitExceededException;
Expand Down Expand Up @@ -106,7 +107,8 @@ public void testNormal() {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
x -> null,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
);

ModelManager manager = mock(ModelManager.class);
Expand Down Expand Up @@ -164,7 +166,8 @@ public void testExecutionException() {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
x -> null,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
);

ModelManager manager = mock(ModelManager.class);
Expand Down Expand Up @@ -280,7 +283,8 @@ public void testCircuitBreaker() {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
x -> null,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
);

ModelManager manager = mock(ModelManager.class);
Expand Down Expand Up @@ -331,7 +335,8 @@ public void testCorruptModel() {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
x -> null,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
);

ModelManager manager = mock(ModelManager.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.opensearch.search.aggregations.bucket.terms.StringTerms;
import org.opensearch.search.aggregations.bucket.terms.TermsAggregator;
import org.opensearch.tasks.Task;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.timeseries.TestHelpers;
import org.opensearch.transport.Transport;
Expand Down Expand Up @@ -101,7 +102,8 @@ public void setUp() throws Exception {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
x -> null,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
);

client = mock(Client.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.opensearch.core.xcontent.ToXContent;
import org.opensearch.core.xcontent.XContentBuilder;
import org.opensearch.tasks.Task;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.transport.Transport;
import org.opensearch.transport.TransportService;
Expand All @@ -55,7 +56,8 @@ public void testNormal() {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
x -> null,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
);

ModelManager manager = mock(ModelManager.class);
Expand Down Expand Up @@ -84,7 +86,8 @@ public void testExecutionException() {
TransportService.NOOP_TRANSPORT_INTERCEPTOR,
x -> null,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
);

ModelManager manager = mock(ModelManager.class);
Expand Down
4 changes: 3 additions & 1 deletion src/test/java/test/org/opensearch/ad/util/FakeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.opensearch.core.indices.breaker.NoneCircuitBreakerService;
import org.opensearch.tasks.TaskManager;
import org.opensearch.tasks.TaskResourceTrackingService;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.test.OpenSearchTestCase;
import org.opensearch.test.tasks.MockTaskManager;
import org.opensearch.threadpool.ThreadPool;
Expand Down Expand Up @@ -90,7 +91,8 @@ public TransportAddress[] addressesFromString(String address) {
transportInterceptor,
boundTransportAddressDiscoveryNodeFunction,
null,
Collections.emptySet()
Collections.emptySet(),
NoopTracer.INSTANCE
) {
@Override
protected TaskManager createTaskManager(
Expand Down
Loading