[GODRIVER-1699] Fix flaky tests in 1.4.0 Created: 20/Jul/20  Updated: 28/Oct/23  Resolved: 29/Jul/20

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.4.0

Type: Improvement Priority: Major - P3
Reporter: Divjot Arora (Inactive) Assignee: Divjot Arora (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

There are some tests that intermittently fail in master/1.4.0:

1. socketTimeoutMS integration test - This test sets a 100ms socketTimeout on the test client to make a Find call fail. This sometimes causes the collection creation or InsertOne call to time out instead.

2. connection unit test - Data race because the read to cancelConnectContext on line 131 races with the connect() call on line 126.

3. aggregate $out with non-primary read pref - After doing the aggregate, the test runs a find to ensure the output collection was created correctly. In a PSS architecture, the find can fail if it runs against a secondary that hasn't replicated the write.

4. CMAP prose test - The test uses MinPoolSize to have the pool create a connection which errors during connecting. The test assumes that the connection has not finished connecting when the resource pool returns it, so the connection.wait() in pool.get() sees the error. If the background connecting routine finishes quicker, though, resourcePool.Get() could see this error and return nil to pool.get(), which would then make a new connection and throw off the event counts by 1.



 Comments   
Comment by Githook User [ 29/Jul/20 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1699 Fix flaky tests (#468)
Branch: release/1.4
https://github.com/mongodb/mongo-go-driver/commit/612412ddc2fbd8199473e8bfb2488c102534ed61

Comment by Githook User [ 29/Jul/20 ]

Author:

{'name': 'Divjot Arora', 'email': 'divjot.arora@10gen.com', 'username': 'divjotarora'}

Message: GODRIVER-1699 Fix flaky tests (#468)
Branch: master
https://github.com/mongodb/mongo-go-driver/commit/1bdb8a8ce888e2892fc4ad40bbefa2dbdd04813c

Comment by Divjot Arora (Inactive) [ 23/Jul/20 ]

https://github.com/mongodb/mongo-go-driver/pull/468

Generated at Thu Feb 08 08:36:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.