Skip to content

Commit a7bd7e9

Browse files
authored
Fixes IngestionDelayTrackerTest.testIngestionDelay (#17037)
* Adds sync block * Fix exception catch block
1 parent 76c2ec2 commit a7bd7e9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pinot-core/src/test/java/org/apache/pinot/core/data/manager/realtime/IngestionDelayTrackerTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ public MockIngestionDelayTracker(ServerMetrics serverMetrics, String tableNameWi
103103

104104
@Override
105105
public void createMetrics(int partitionId) {
106-
if (_partitionToMetricToValues == null) {
107-
_partitionToMetricToValues = new ConcurrentHashMap<>();
108-
_scheduledExecutorService = Executors.newScheduledThreadPool(2);
106+
synchronized (this) {
107+
if (_partitionToMetricToValues == null) {
108+
_partitionToMetricToValues = new ConcurrentHashMap<>();
109+
_scheduledExecutorService = Executors.newScheduledThreadPool(2);
110+
}
109111
}
110112
Map<String, List<Long>> metricToValues = new HashMap<>();
111113
_partitionToMetricToValues.put(partitionId, metricToValues);
@@ -481,7 +483,7 @@ public void testIngestionDelay() {
481483
TestUtils.waitForCondition((aVoid) -> {
482484
try {
483485
verifyMetrics(partitionToMetricToValues);
484-
} catch (Error e) {
486+
} catch (Throwable t) {
485487
return false;
486488
}
487489
return true;

0 commit comments

Comments
 (0)