[JAVA-3877] Address occasional failure of ServerDescriptionTest.testDefaults Created: 03/Nov/20  Updated: 12/Apr/22  Resolved: 14/Dec/20

Status: Closed
Project: Java Driver
Component/s: Test Coverage
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Ross Lawley
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

ServerDescriptionTest.testDefaults occasionally fails in CI. Let's figure out why and fix it.

The failed assertion is:

        assertTrue(serverDescription.getLastUpdateTime(TimeUnit.NANOSECONDS) > currentNanoTime);

So looks like System.nanoTime() doesn't always move forward fast enough.



 Comments   
Comment by Githook User [ 12/Apr/22 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Fix: ServerDescriptionTest.testDefaults

Ensure latest time is greater or equal to the test time.

JAVA-3877
Branch: 3.12.x
https://github.com/mongodb/mongo-java-driver/commit/d7acfc676f92bc77cef2b73800e2fbd9d10f554b

Comment by Githook User [ 14/Dec/20 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Fix: ServerDescriptionTest.testDefaults

Ensure latest time is greater or equal to the test time.

JAVA-3877
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/f67efcbc44c310008dfeb9e003d9394a1be5cddf

Generated at Thu Feb 08 09:00:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.