@@ -3,63 +3,50 @@ const path = require('path');
33const { loadSpecTests } = require ( '../../spec/index' ) ;
44const { runUnifiedSuite } = require ( '../../tools/unified-spec-runner/runner' ) ;
55
6- const SKIP = [
7- // Verified they use the same connection but the Node implementation executes
8- // a getMore before the killCursors even though the stream is immediately
9- // closed.
10- // TODO(NODE-3970): implement and reference a node specific integration test for this
11- 'change streams pin to a connection' ,
6+ const filter = ( { description } ) => {
7+ if ( description === 'change streams pin to a connection' ) {
8+ // Verified they use the same connection but the Node implementation executes
9+ // a getMore before the killCursors even though the stream is immediately
10+ // closed.
11+ // TODO(NODE-3970): implement and reference a node specific integration test for this
12+ return 'TODO(NODE-3970): implement and reference a node specific integration test for this' ;
13+ }
1214
13- // TODO(DRIVERS-1847): The following three tests are skipped pending a decision made on DRIVERS-1847,
14- // since pinning the connection on any getMore error is very awkward in node and likely results
15- // in sub-optimal pinning.
16- 'pinned connections are not returned after an network error during getMore' ,
17- 'pinned connections are not returned to the pool after a non-network error on getMore' ,
18- 'stale errors are ignored' ,
15+ if (
16+ [
17+ 'pinned connections are not returned after an network error during getMore' ,
18+ 'pinned connections are not returned to the pool after a non-network error on getMore' ,
19+ 'stale errors are ignored'
20+ ] . includes ( description )
21+ ) {
22+ // TODO(DRIVERS-1847): The above three tests are skipped pending a decision made in DRIVERS-1847
23+ // since pinning the connection on any getMore error is very awkward in node and likely results
24+ // in sub-optimal pinning.
25+ return 'TODO(DRIVERS-1847): Skipped pending a decision made on DRIVERS-1847' ;
26+ }
1927
20- // This test is skipped because it assumes drivers attempt connections on the first operation,
21- // but Node has a connect() method that is called before the first operation is ever run.
22- // TODO(NODE-2149): Refactor connect()
23- 'errors during the initial connection hello are ignored' ,
28+ if ( description === 'errors during the initial connection hello are ignored' ) {
29+ // This test is skipped because it assumes drivers attempt connections on the first operation,
30+ // but Node has a connect() method that is called before the first operation is ever run.
31+ return 'TODO(NODE-2149): Refactor connect()' ;
32+ }
2433
25- ...( process . env . SERVERLESS
26- ? [
27- // TODO(NODE-2471): Unskip these when there isn't a ping command sent when credentials are defined
28- 'no connection is pinned if all documents are returned in the initial batch' ,
29- 'pinned connections are returned when the cursor is drained' ,
30- 'pinned connections are returned to the pool when the cursor is closed' ,
31- 'pinned connections are returned after a network error during a killCursors request' ,
32- 'aggregate pins the cursor to a connection' ,
33- 'errors during the initial connection hello are ignored' ,
34- 'all operations go to the same mongos' ,
35- 'transaction can be committed multiple times' ,
36- 'pinned connection is not released after a non-transient CRUD error' ,
37- 'pinned connection is not released after a non-transient commit error' ,
38- 'pinned connection is released after a non-transient abort error' ,
39- 'pinned connection is released after a transient network commit error' ,
40- 'pinned connection is released after a transient non-network abort error' ,
41- 'pinned connection is released after a transient network abort error' ,
42- 'pinned connection is released on successful abort' ,
43- 'pinned connection is returned when a new transaction is started' ,
44- 'pinned connection is returned when a non-transaction operation uses the session' ,
45- 'a connection can be shared by a transaction and a cursor' ,
46- 'wait queue timeout errors include cursor statistics' ,
47- 'wait queue timeout errors include transaction statistics'
48- ]
49- : [ ] ) ,
34+ if (
35+ process . env . AUTH === 'auth' &&
36+ [
37+ 'errors during authentication are processed' ,
38+ 'wait queue timeout errors include cursor statistics' ,
39+ 'wait queue timeout errors include transaction statistics' ,
40+ 'operations against non-load balanced clusters fail if URI contains loadBalanced=true' ,
41+ 'operations against non-load balanced clusters succeed if URI contains loadBalanced=false'
42+ ] . includes ( description )
43+ ) {
44+ return 'TODO(NODE-3891): fix tests broken when AUTH enabled' ;
45+ }
5046
51- // TODO: NODE-3891 - fix tests broken when AUTH enabled
52- ...( process . env . AUTH === 'auth'
53- ? [
54- 'errors during authentication are processed' ,
55- 'wait queue timeout errors include cursor statistics' ,
56- 'wait queue timeout errors include transaction statistics' ,
57- 'operations against non-load balanced clusters fail if URI contains loadBalanced=true' ,
58- 'operations against non-load balanced clusters succeed if URI contains loadBalanced=false'
59- ]
60- : [ ] )
61- ] ;
47+ return false ;
48+ } ;
6249
6350describe ( 'Load Balancer Unified Tests' , function ( ) {
64- runUnifiedSuite ( loadSpecTests ( path . join ( 'load-balancers' ) ) , SKIP ) ;
51+ runUnifiedSuite ( loadSpecTests ( path . join ( 'load-balancers' ) ) , filter ) ;
6552} ) ;
0 commit comments