Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1699

Fix flaky tests in 1.4.0

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.4.0
    • Affects Version/s: None
    • Component/s: None
    • None

      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.

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: