[JAVA-3726] "Parse lastWriteDate" test requires a larger periodic noop write interval Created: 08/May/20  Updated: 04/Jun/20  Resolved: 04/Jun/20

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

Type: Improvement Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends

 Description   

Description of Drivers Ticket:

The "Parse lastWriteDate" from the Max Staleness tests may not succeed if mongod is configured with periodicNoopIntervalSecs of 1.

The test verifies that the client observes an increase in lastWriteDate after performing these steps (copied verbatim):

1. Insert a document and wait one second.
2. Get the client's ServerDescription for the server. It must have a non-zero lastWriteDate.
3. Insert a document and wait one second.
4. Get the client's ServerDescription for the server.

I believe this is due to setting the periodicNoopIntervalSecs to 1 in mongo orchestration from this change.

libmongoc's implementation of this test was inconsistently failing. And the resulting investigation (CDRIVER-2985) observed this was due to the periodic noop writer inserting shortly before step 2. Since lastWriteDate has second-level granularity, the insert of step 3 is applied within the same second. And both ServerDescriptions may end up reporting the same lastWriteDate by the end of the test.

I think the most straightforward fix is to add another sleep between the first server selection and the insert, so they do not end up falling within the same second.
See DRIVERS-1215 for updated details.



 Comments   
Comment by Jeffrey Yemin [ 04/Jun/20 ]

These tests were implemented as unit tests in the initial implementation of maxStaleness: see https://github.com/mongodb/mongo-java-driver/commit/69078736a625cb21d27dc02fbb0c6211eba42d7d#diff-f3f528c2279985a95e397ca6027944fa.

At this point, it doesn't seem worth the effort to change the tests to integration tests.  Closing as Won't Fix.

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