File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 10
10
use MongoDB \Driver \Session ;
11
11
use MongoDB \GridFS \Bucket ;
12
12
use MongoDB \Model \IndexInfo ;
13
+ use MongoDB \Operation \DatabaseCommand ;
13
14
use MongoDB \Operation \FindOneAndReplace ;
14
15
use MongoDB \Operation \FindOneAndUpdate ;
15
16
use PHPUnit \Framework \Assert ;
@@ -540,13 +541,9 @@ private function executeForTestRunner()
540
541
$ args ['client ' ]->selectDatabase ('admin ' )->command ($ args ['failPoint ' ]);
541
542
break ;
542
543
case 'targetedFailPoint ' :
543
- /* We could execute a command on the server directly, but using
544
- * a client will exercise the library's pinning logic. */
545
544
assertNotNull ($ args ['session ' ]->getServer (), 'Session is pinned ' );
546
- $ client = $ this ->entityMap ->getClient (
547
- $ this ->entityMap ->getRootClientIdOf ($ this ->arguments ['session ' ])
548
- );
549
- $ client ->selectDatabase ('admin ' )->command ($ args ['failPoint ' ]);
545
+ $ operation = new DatabaseCommand ('admin ' , $ args ['failPoint ' ]);
546
+ $ operation ->execute ($ args ['session ' ]->getServer ());
550
547
break ;
551
548
default :
552
549
Assert::fail ('Unsupported test runner operation: ' . $ this ->name );
You can’t perform that action at this time.
0 commit comments