Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-572

Update test event listeners to use channels instead of delays

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

      Tests often need to assert that certain events were emitted from tasks spawned in the drop implementations of various types. Usually, these tests just wait for a period before checking if the event occurred, failing otherwise. This leads to spurious failures when the tasks aren't scheduled fast enough. The tests should be updated to read from channels that are notified when certain events are emitted, utilizing higher timeouts than the current delays. This will allow tests to pass quickly in most cases but also wait for events that take longer to be emitted, reducing inconsistent test failures.

      This is currently being done for the CMAP spec tests (which fail often in this manner) in RUST-304.

      Example failure from the kill_cursors_on_drop test: https://evergreen.mongodb.com/task_log_raw/mongo_rust_driver_tests__async_runtime~async_std_auth_and_tls~noauth_and_notls_os~windows_64_vs2017_small_test_3.6_replica_set_b0e59f9fde2e5bc3df3217dec05ffbca553d1b8e_20_09_10_23_41_49/0?type=T#L1595

            Assignee:
            Unassigned Unassigned
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: