|
| 1 | +package spectest |
| 2 | + |
| 3 | +import "testing" |
| 4 | + |
| 5 | +// skipTests is a map of fully-qualified test name to the reason for skipping |
| 6 | +// the test. |
| 7 | +var skipTests = map[string]string{ |
| 8 | + "TestURIOptionsSpec/single-threaded-options.json/Valid_options_specific_to_single-threaded_drivers_are_parsed_correctly": "the Go Driver is not single-threaded.", |
| 9 | + // GODRIVER-2348: The wtimeoutMS write concern option is not supported. |
| 10 | + "TestURIOptionsSpec/concern-options.json/Valid_read_and_write_concern_are_parsed_correctly": "the wtimeoutMS write concern option is not supported", |
| 11 | + |
| 12 | + // SPEC-1403: This test checks to see if the correct error is thrown when |
| 13 | + // auto encrypting with a server < 4.2. Currently, the test will fail |
| 14 | + // because a server < 4.2 wouldn't have mongocryptd, so Client construction |
| 15 | + // would fail with a mongocryptd spawn error. |
| 16 | + "TestUnifiedSpecs/client-side-encryption/legacy/maxWireVersion.json/operation_fails_with_maxWireVersion_<_8": "servers less than 4.2 do not have mongocryptd; see SPEC-1403", |
| 17 | + |
| 18 | + // GODRIVER-2123: The two tests below use a failpoint and a socket or server |
| 19 | + // selection timeout. The timeout causes the eventual clearing of the |
| 20 | + // failpoint in the test runner to fail with an i/o timeout. |
| 21 | + "TestUnifiedSpecs/server-discovery-and-monitoring/unified/find-network-timeout-error.json/Ignore_network_timeout_error_on_find": "failpoints and timeouts together cause failures; see GODRIVER-2123", |
| 22 | + "TestUnifiedSpecs/server-discovery-and-monitoring/unified/minPoolSize-error.json/Network_error_on_minPoolSize_background_creation": "failpoints and timeouts together cause failures; see GODRIVER-2123", |
| 23 | + |
| 24 | + // GODRIVER-1827: These 2 tests assert that in-use connections are not |
| 25 | + // closed until checked back into a closed pool, but the Go connection pool |
| 26 | + // aggressively closes in-use connections. That behavior is currently |
| 27 | + // required by the "Client.Disconnect" API, so skip the tests. |
| 28 | + "TestCMAPSpec/pool-close-destroy-conns.json/When_a_pool_is_closed,_it_MUST_first_destroy_all_available_connections_in_that_pool": "test requires that close does not aggressively close used connections", |
| 29 | + "TestCMAPSpec/pool-close-destroy-conns.json/must_destroy_checked_in_connection_if_pool_has_been_closed": "test requires that close does not aggressively close used connections", |
| 30 | + |
| 31 | + // GODRIVER-1826: The load-balancer SDAM error handling test "errors during |
| 32 | + // authentication are processed" currently asserts that handshake errors |
| 33 | + // trigger events "pool cleared" then "connection closed". However, the |
| 34 | + // "error during minPoolSize population clears pool" test asserts that |
| 35 | + // handshake errors trigger events "connection closed" then "pool cleared". |
| 36 | + // The Go driver uses the same code path for creating all application |
| 37 | + // connections, so those opposing event orders cannot be satisfied |
| 38 | + // simultaneously. |
| 39 | + // |
| 40 | + // TODO(DRIVERS-1785): Re-enable this test once the spec test is updated to |
| 41 | + // use the same event order as the "errors during authentication are |
| 42 | + // processed" load-balancer SDAM spec test. |
| 43 | + "TestCMAPSpec/pool-create-min-size-error.json/error_during_minPoolSize_population_clears_pool": "event ordering is incompatible with load-balancer SDAM spec test (DRIVERS-1785)", |
| 44 | + |
| 45 | + // GODRIVER-1826: The Go connection pool does not currently always deliver |
| 46 | + // connections created by maintain() to waiting check-outs. There is a race |
| 47 | + // condition between the goroutine started by maintain() to check-in a |
| 48 | + // requested connection and createConnections() picking up the next wantConn |
| 49 | + // created by the waiting check-outs. Most of the time, createConnections() |
| 50 | + // wins and starts creating new connections. That is not a problem for |
| 51 | + // general use cases, but it prevents the "threads blocked by maxConnecting |
| 52 | + // check out minPoolSize connections" test from passing. |
| 53 | + // |
| 54 | + // TODO(DRIVERS-2225): Re-enable this test once the spec test is updated to |
| 55 | + // support the Go pool minPoolSize maintain() behavior. |
| 56 | + "TestCMAPSpec/pool-checkout-minPoolSize-connection-maxConnecting.json/threads_blocked_by_maxConnecting_check_out_minPoolSize_connections": "test requires that connections established by minPoolSize are immediately used to satisfy check-out requests (DRIVERS-2225)", |
| 57 | + |
| 58 | + // GODRIVER-1826: The Go connection pool currently delivers any available |
| 59 | + // connection to the earliest waiting check-out request, independent of if |
| 60 | + // that check-out request already requested a new connection. That behavior |
| 61 | + // is currently incompatible with the "threads blocked by maxConnecting |
| 62 | + // check out returned connections" test, which expects that check-out |
| 63 | + // requests that request a new connection cannot be satisfied by a check-in. |
| 64 | + // |
| 65 | + // TODO(DRIVERS-2223): Re-enable this test once the spec test is updated to |
| 66 | + // support the Go pool check-in behavior. |
| 67 | + "TestCMAPSpec/pool-checkout-returned-connection-maxConnecting.json/threads_blocked_by_maxConnecting_check_out_returned_connections": "test requires a checked-in connections cannot satisfy a check-out waiting on a new connection (DRIVERS-2223)", |
| 68 | + |
| 69 | + // TODO(GODRIVER-2129): Re-enable this test once GODRIVER-2129 is done. |
| 70 | + "TestAuthSpec/connection-string.json/must_raise_an_error_when_the_hostname_canonicalization_is_invalid": "support will be added with GODRIVER-2129.", |
| 71 | +} |
| 72 | + |
| 73 | +// CheckSkip checks if the fully-qualified test name matches a skipped test |
| 74 | +// name. If the test name matches, the reason is logged and the test is skipped. |
| 75 | +func CheckSkip(t *testing.T) { |
| 76 | + if reason := skipTests[t.Name()]; reason != "" { |
| 77 | + t.Skipf("Skipping due to known failure: %q", reason) |
| 78 | + } |
| 79 | +} |
0 commit comments