[JAVA-3967] Investigate MongoClientListenerRegistration test failure Created: 27/Jan/21  Updated: 30/Mar/22

Status: Backlog
Project: Java Driver
Component/s: Reactive Streams, Test Failure
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Investigate flaky tests

 Description   

https://evergreen.mongodb.com/task/mongo_java_driver_tests_jdk8_unsecure__version~3.2_os~linux_topology~replicaset_auth~noauth_ssl~nossl_jdk~jdk8_test_82129d04205d9b493ab910cfe3a4b17cf016b41e_21_01_26_23_53_26

[2021/01/27 00:13:52.207] com.mongodb.reactivestreams.client.MongoClientListenerRegistrationSpecification > should register event listeners FAILED
[2021/01/27 00:13:52.207]     Too few invocations for:
[2021/01/27 00:13:52.207]     (1.._) * _   (0 invocations)
[2021/01/27 00:13:52.207]     Unmatched invocations (ordered by similarity):
[2021/01/27 00:13:52.207]     None
[2021/01/27 00:13:52.207]         at org.spockframework.mock.runtime.InteractionScope.verifyInteractions(InteractionScope.java:104)
[2021/01/27 00:13:52.207]         at org.spockframework.mock.runtime.MockController.leaveScope(MockController.java:77)
[2021/01/27 00:13:52.207]         at com.mongodb.reactivestreams.client.MongoClientListenerRegistrationSpecification.should register event listeners(MongoClientListenerRegistrationSpecification.groovy:68)
[2021/01/27 00:13:52.207] com.mongodb.reactivestreams.client.MongoClientListenerRegistrationSpecification > should register multiple command listeners STANDARD_OUT



 Comments   
Comment by Jeffrey Yemin [ 08/Mar/21 ]

Moving back to open until we have time to investigate the root cause of the test failure. For now, the test is being ignored.

Comment by Githook User [ 08/Mar/21 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Disable event listener test in reactive streams driver

This test fails intermittently in continuous integration tests.
It's not clear why but it doesn't appear likely to be a bug in
the driver that is causing the failure, but rather in the test
expectations. As the same test succeeds consistently in the
sync driver, disabling the reactive streams-base one for now
until we have time to more fully investigate.

JAVA-3967
Branch: 4.2.x
https://github.com/mongodb/mongo-java-driver/commit/33d601724f576bef248809764d8cac079a0e9e06

Comment by Githook User [ 08/Mar/21 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Disable event listener test in reactive streams driver

This test fails intermittently in continuous integration tests.
It's not clear why but it doesn't appear likely to be a bug in
the driver that is causing the failure, but rather in the test
expectations. As the same test succeeds consistently in the
sync driver, disabling the reactive streams-base one for now
until we have time to more fully investigate.

JAVA-3967
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/d6c40956dbe6fc6eaa6738197897dcd1551e6cf3

Comment by Jeffrey Yemin [ 08/Mar/21 ]

I tried re-writing the method to ensure that all the code under test was in the when clause (currently it's in the then clause, and also re-writing the mock expectations so that when one them fails it's clear which one. I ran a patch build to see if it would still fail and eventually it did: https://evergreen.mongodb.com/task/mongo_java_driver_tests_snappy_compression__version~4.0_os~linux_topology~standalone_auth~noauth_ssl~nossl_compressor~snappy_jdk~jdk8_test_patch_9932dd05c6a09142b5f95a25624e8793048b335e_60457fe53e8e86386b9a07fe_21_03_08_01_37_53##comparehashes=9932dd05c6a09142b5f95a25624e8793048b335e&threads=maxonly

So re-organizing the code didn't help, but we do at least see that at least in one case it's the ServerMonitorListener expectation that fails. It's not obvious how this could be since the server monitor has to run prior to completion of running a command.

Since only the driver-reactive-streams version of this test ever fails, and it fails only rarely, there must be some data race that only shows up when in async mode, but it's not clear what it could be.

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