Skip to content

Commit f9ecda3

Browse files
committed
Fix building tests
1 parent 8d3cfbe commit f9ecda3

File tree

4 files changed

+13
-23
lines changed

4 files changed

+13
-23
lines changed

x-pack/plugin/profiling/src/test/java/org/elasticsearch/xpack/profiling/action/GetStackTracesResponseTests.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ private GetStackTracesResponse createTestInstance() {
2727
new int[] { 1083999 },
2828
new String[] { "QCCDqjSg3bMK1C4YRK6Tiw" },
2929
new String[] { "QCCDqjSg3bMK1C4YRK6TiwAAAAAAEIpf" },
30-
new int[] { 2 },
31-
0.3d,
32-
2.7d,
33-
1
30+
new int[] { 2 }
3431
)
3532
)
3633
);
@@ -49,7 +46,9 @@ private GetStackTracesResponse createTestInstance() {
4946
Map<String, String> executables = randomNullable(Map.of("QCCDqjSg3bMK1C4YRK6Tiw", "libc.so.6"));
5047
long totalSamples = randomLongBetween(1L, 200L);
5148
String stackTraceID = randomAlphaOfLength(12);
52-
Map<String, TraceEvent> stackTraceEvents = randomNullable(Map.of(stackTraceID, new TraceEvent(stackTraceID, totalSamples)));
49+
Map<TraceEventID, TraceEvent> stackTraceEvents = randomNullable(
50+
Map.of(new TraceEventID("", "", "", stackTraceID), new TraceEvent(totalSamples))
51+
);
5352

5453
return new GetStackTracesResponse(stackTraces, stackFrames, executables, stackTraceEvents, totalFrames, 1.0, totalSamples);
5554
}

x-pack/plugin/profiling/src/test/java/org/elasticsearch/xpack/profiling/action/SubGroupCollectorTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
public class SubGroupCollectorTests extends ESTestCase {
2020
public void testNoAggs() {
2121
TermsAggregationBuilder stackTraces = new TermsAggregationBuilder("stacktraces").field("stacktrace.id");
22-
TraceEvent traceEvent = new TraceEvent("1");
22+
TraceEvent traceEvent = new TraceEvent(1L);
2323

2424
SubGroupCollector collector = SubGroupCollector.attach(stackTraces, new String[0], false);
2525
assertTrue("Sub aggregations attached", stackTraces.getSubAggregations().isEmpty());
@@ -32,7 +32,7 @@ public void testNoAggs() {
3232

3333
public void testMultipleAggsInSingleStackTrace() {
3434
TermsAggregationBuilder stackTraces = new TermsAggregationBuilder("stacktraces").field("stacktrace.id");
35-
TraceEvent traceEvent = new TraceEvent("1");
35+
TraceEvent traceEvent = new TraceEvent(1L);
3636

3737
SubGroupCollector collector = SubGroupCollector.attach(stackTraces, new String[] { "service.name", "transaction.name" }, false);
3838
assertFalse("No sub aggregations attached", stackTraces.getSubAggregations().isEmpty());
@@ -71,7 +71,7 @@ public void testMultipleAggsInSingleStackTrace() {
7171

7272
public void testSingleAggInMultipleStackTraces() {
7373
TermsAggregationBuilder stackTraces = new TermsAggregationBuilder("stacktraces").field("stacktrace.id");
74-
TraceEvent traceEvent = new TraceEvent("1");
74+
TraceEvent traceEvent = new TraceEvent(1L);
7575

7676
SubGroupCollector collector = SubGroupCollector.attach(stackTraces, new String[] { "service.name" }, false);
7777
assertFalse("No sub aggregations attached", stackTraces.getSubAggregations().isEmpty());

x-pack/plugin/profiling/src/test/java/org/elasticsearch/xpack/profiling/action/TransportGetFlamegraphActionTests.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,12 @@ public void testCreateFlamegraph() {
3939
"fr28zxcZ2UDasxYuu6dV-wAAAAAAxjUZ",
4040
"fr28zxcZ2UDasxYuu6dV-wAAAAAA0Gra",
4141
"fr28zxcZ2UDasxYuu6dV-wAAAAAA-VK9" },
42-
new int[] { 3, 3, 3, 3, 3, 3, 3, 3, 3 },
43-
0.3d,
44-
2.7d,
45-
1
42+
new int[] { 3, 3, 3, 3, 3, 3, 3, 3, 3 }
4643
)
4744
),
4845
Map.of(),
4946
Map.of("fr28zxcZ2UDasxYuu6dV-w", "containerd"),
50-
Map.of("2buqP1GpF-TXYmL4USW8gA", new TraceEvent("2buqP1GpF-TXYmL4USW8gA", 1L)),
47+
Map.of(new TraceEventID("", "", "", "2buqP1GpF-TXYmL4USW8gA"), new TraceEvent(1L)),
5148
9,
5249
1.0d,
5350
1

x-pack/plugin/profiling/src/test/java/org/elasticsearch/xpack/profiling/action/TransportGetTopNFunctionsActionTests.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,12 @@ public void testCreateAllTopNFunctions() {
3939
"fr28zxcZ2UDasxYuu6dV-wAAAAAAxjUZ",
4040
"fr28zxcZ2UDasxYuu6dV-wAAAAAA0Gra",
4141
"fr28zxcZ2UDasxYuu6dV-wAAAAAA-VK9" },
42-
new int[] { 3, 3, 3, 3, 3, 3, 3, 3, 3 },
43-
0.3d,
44-
2.7d,
45-
1
42+
new int[] { 3, 3, 3, 3, 3, 3, 3, 3, 3 }
4643
)
4744
),
4845
Map.of(),
4946
Map.of("fr28zxcZ2UDasxYuu6dV-w", "containerd"),
50-
Map.of("2buqP1GpF-TXYmL4USW8gA", new TraceEvent("2buqP1GpF-TXYmL4USW8gA", 1L)),
47+
Map.of(new TraceEventID("", "", "", "2buqP1GpF-TXYmL4USW8gA"), new TraceEvent(1L)),
5148
9,
5249
1.0d,
5350
1
@@ -104,15 +101,12 @@ public void testCreateTopNFunctionsWithLimit() {
104101
"fr28zxcZ2UDasxYuu6dV-wAAAAAAxjUZ",
105102
"fr28zxcZ2UDasxYuu6dV-wAAAAAA0Gra",
106103
"fr28zxcZ2UDasxYuu6dV-wAAAAAA-VK9" },
107-
new int[] { 3, 3, 3, 3, 3, 3, 3, 3, 3 },
108-
0.3d,
109-
2.7d,
110-
1
104+
new int[] { 3, 3, 3, 3, 3, 3, 3, 3, 3 }
111105
)
112106
),
113107
Map.of(),
114108
Map.of("fr28zxcZ2UDasxYuu6dV-w", "containerd"),
115-
Map.of("2buqP1GpF-TXYmL4USW8gA", new TraceEvent("2buqP1GpF-TXYmL4USW8gA", 1L)),
109+
Map.of(new TraceEventID("", "", "", "2buqP1GpF-TXYmL4USW8gA"), new TraceEvent(1L)),
116110
9,
117111
1.0d,
118112
1

0 commit comments

Comments
 (0)