You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/09/06 14:29:48 UTC

[GitHub] [lucene] rmuir commented on a diff in pull request #11749: Remove usages of System.currentTimeMillis() from tests

rmuir commented on code in PR #11749:
URL: https://github.com/apache/lucene/pull/11749#discussion_r963782724


##########
lucene/classification/src/test/org/apache/lucene/classification/Test20NewsgroupsClassification.java:
##########
@@ -123,13 +124,13 @@ public void test20Newsgroups() throws Exception {
 
         System.out.println("Indexing 20 Newsgroups...");
 
-        long startIndex = System.currentTimeMillis();
+        long startIndex = Clock.systemDefaultZone().millis();

Review Comment:
   Can we fix this test to use `nanoTime` too (monotonic clock), rather than the system clock? Currently, the `precommit` checks are angry about use of the default time zone, but we can avoid dealing with timezones completely here i think?



-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org