FrankChen021 commented on code in PR #19911:
URL: https://github.com/apache/druid/pull/19911#discussion_r3735946590
##########
server/src/test/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinatorReadOnlyTest.java:
##########
@@ -88,12 +84,12 @@ public static Object[][] testParameters()
};
}
- public
IndexerSQLMetadataStorageCoordinatorReadOnlyTest(SegmentMetadataCache.UsageMode
cacheMode)
+ public void
initIndexerSQLMetadataStorageCoordinatorReadOnlyTest(SegmentMetadataCache.UsageMode
cacheMode)
{
this.cacheMode = cacheMode;
}
- @Before
+ @BeforeEach
Review Comment:
[P1] Parameterized cache mode is initialized after setup
JUnit 5 runs setup() before each parameterized test, but cacheMode is
assigned only inside the test method. The setup therefore sees null;
SegmentsMetadataManagerConfig defaults that to IF_SYNCED, so ALWAYS, NEVER, and
IF_SYNCED cases all exercise the same mode and the NEVER path is not tested.
Initialize the fixture after assigning the argument or use
parameterized-class/constructor lifecycle.
##########
embedded-tests/src/test/java/org/apache/druid/testing/embedded/EmbeddedMetricEventPredicates.java:
##########
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.testing.embedded;
+
+import org.apache.druid.java.util.emitter.core.Event;
+import org.apache.druid.java.util.emitter.service.ServiceMetricEvent;
+import org.apache.druid.server.metrics.LatchableEmitter;
+
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.function.Predicate;
+
+public class EmbeddedMetricEventPredicates
+{
+ private static final long WAIT_TIMEOUT_MILLIS = 60_000;
Review Comment:
[P2] Metric waits ignore configured emitter timeouts
Both helpers pass a fixed 60-second timeout to LatchableEmitter. The
previous call sites used overloads that honored the emitter's configured
default; several current clusters explicitly configure 300- or 600-second
waits. Legitimate waits exceeding 60 seconds can now fail despite those
settings. Preserve the configured timeout or expose an explicit timeout
parameter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]