@@ -3,63 +3,44 @@ const path = require('path');
3
3
const { loadSpecTests } = require ( '../../spec/index' ) ;
4
4
const { runUnifiedSuite } = require ( '../../tools/unified-spec-runner/runner' ) ;
5
5
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)' ;
13
+ }
12
14
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 following three tests are skipped pending a decision made on 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)' ;
26
+ }
19
27
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 (
29
+ process . env . AUTH === 'auth' &&
30
+ [
31
+ 'errors during authentication are processed' ,
32
+ 'wait queue timeout errors include cursor statistics' ,
33
+ 'wait queue timeout errors include transaction statistics' ,
34
+ 'operations against non-load balanced clusters fail if URI contains loadBalanced=true' ,
35
+ 'operations against non-load balanced clusters succeed if URI contains loadBalanced=false'
36
+ ] . includes ( description )
37
+ ) {
38
+ return 'TODO(NODE-3891): fix tests broken when AUTH enabled' ;
39
+ }
24
40
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
- : [ ] ) ,
50
-
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
- ] ;
41
+ return null ;
42
+ } ;
62
43
63
44
describe ( 'Load Balancer Unified Tests' , function ( ) {
64
- runUnifiedSuite ( loadSpecTests ( path . join ( 'load-balancers' ) ) , SKIP ) ;
45
+ runUnifiedSuite ( loadSpecTests ( path . join ( 'load-balancers' ) ) , filter ) ;
65
46
} ) ;
0 commit comments