This is an automated email from the ASF dual-hosted git repository.

adarshsanjeev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 79c272183c0 fix: Fix for flaky embedded test QueryVirtualStorageTest
79c272183c0 is described below

commit 79c272183c0c8fdf99f77c1578902e0423d4d98d
Author: Adarsh Sanjeev <[email protected]>
AuthorDate: Thu Jul 9 19:59:22 2026 +0530

    fix: Fix for flaky embedded test QueryVirtualStorageTest
    
    Adds a null check to ensure that the test does not fail due to a race.
---
 .../java/org/apache/druid/java/util/metrics/StubServiceEmitter.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/processing/src/test/java/org/apache/druid/java/util/metrics/StubServiceEmitter.java
 
b/processing/src/test/java/org/apache/druid/java/util/metrics/StubServiceEmitter.java
index 4bcdd58f182..d9bd02aa0ba 100644
--- 
a/processing/src/test/java/org/apache/druid/java/util/metrics/StubServiceEmitter.java
+++ 
b/processing/src/test/java/org/apache/druid/java/util/metrics/StubServiceEmitter.java
@@ -152,8 +152,10 @@ public class StubServiceEmitter extends ServiceEmitter 
implements MetricsVerifie
   {
     final Queue<ServiceMetricEvent> metricEventQueue = 
metricEvents.get(metricName);
     long total = 0;
-    for (ServiceMetricEvent event : metricEventQueue) {
-      total += event.getValue().longValue();
+    if (metricEventQueue != null) {
+      for (ServiceMetricEvent event : metricEventQueue) {
+        total += event.getValue().longValue();
+      }
     }
     return total;
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to