github-code-scanning[bot] commented on code in PR #15103:
URL: https://github.com/apache/druid/pull/15103#discussion_r1349091950
##########
extensions-core/lookups-cached-global/src/test/java/org/apache/druid/server/lookup/namespace/cache/JdbcExtractionNamespaceTest.java:
##########
@@ -399,6 +404,46 @@
}
}
+ @Test
+ public void testRandomJitter()
+ {
+ JdbcExtractionNamespace extractionNamespace = new JdbcExtractionNamespace(
+ derbyConnectorRule.getMetadataConnectorConfig(),
+ TABLE_NAME,
+ KEY_NAME,
+ VAL_NAME,
+ tsColumn,
+ FILTER_COLUMN + "='1'",
+ new Period(0),
+ null,
+ 120,
+ new JdbcAccessSecurityConfig()
+ );
+ long jitter = extractionNamespace.getJitter();
+ // jitter will be a random value between 0 and 120 seconds.
+ assertTrue(jitter >= 0 && jitter <= 120000);
+ }
+
+ @Test
+ public void testRandomJitterNotSpecified()
+ {
+ JdbcExtractionNamespace extractionNamespace = new JdbcExtractionNamespace(
+ derbyConnectorRule.getMetadataConnectorConfig(),
+ TABLE_NAME,
+ KEY_NAME,
+ VAL_NAME,
+ tsColumn,
+ FILTER_COLUMN + "='1'",
+ new Period(0),
+ null,
+ null,
+ new JdbcAccessSecurityConfig()
+ );
+ long jitter = extractionNamespace.getJitter();
Review Comment:
## Unread local variable
Variable 'long jitter' is never read.
[Show more
details](https://github.com/apache/druid/security/code-scanning/5877)
--
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]