File tree Expand file tree Collapse file tree 3 files changed +68
-1
lines changed Expand file tree Collapse file tree 3 files changed +68
-1
lines changed Original file line number Diff line number Diff line change 2
2
Causal consistency: unacknowledged write does not update operationTime
3
3
--SKIPIF--
4
4
<?php require __DIR__ . "/../utils/basic-skipif.inc " ; ?>
5
- <?php NEEDS ('REPLICASET ' ); CLEANUP (REPLICASET ); ?>
5
+ <?php NEEDS ('REPLICASET ' ); CLEANUP (REPLICASET ); ?>
6
6
--FILE--
7
7
<?php
8
8
require_once __DIR__ . "/../utils/basic.inc " ;
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Causal consistency: $clusterTime is not sent in commands to unsupported deployments
3
+ --SKIPIF--
4
+ <?php if (getenv ("TRAVIS " )) exit ("skip This currently fails on Travis because it doesn't run 3.6 yet " ); ?>
5
+ <?php require __DIR__ . "/../utils/basic-skipif.inc " ; ?>
6
+ <?php NEEDS ('STANDALONE ' ); ?>
7
+ --FILE--
8
+ <?php
9
+ require_once __DIR__ . "/../utils/basic.inc " ;
10
+ require_once __DIR__ . "/../utils/observer.php " ;
11
+
12
+ (new CommandObserver )->observe (
13
+ function () {
14
+ $ manager = new MongoDB \Driver \Manager (STANDALONE );
15
+ $ session = $ manager ->startSession ();
16
+
17
+ $ query = new MongoDB \Driver \Query ([]);
18
+ $ manager ->executeQuery (NS , $ query , ['session ' => $ session ]);
19
+ $ manager ->executeQuery (NS , $ query , ['session ' => $ session ]);
20
+ },
21
+ function (stdClass $ command )
22
+ {
23
+ $ hasClusterTime = isset ($ command ->{'$clusterTime ' });
24
+ printf ("Command includes \$clusterTime: %s \n" , ($ hasClusterTime ? 'yes ' : 'no ' ));
25
+ }
26
+ );
27
+
28
+ ?>
29
+ ===DONE===
30
+ <?php exit (0 ); ?>
31
+ --EXPECT--
32
+ Command includes $clusterTime: no
33
+ Command includes $clusterTime: no
34
+ ===DONE===
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Causal consistency: $clusterTime is sent in commands to supported deployments
3
+ --SKIPIF--
4
+ <?php require __DIR__ . "/../utils/basic-skipif.inc " ; ?>
5
+ <?php NEEDS ('REPLICASET ' ); ?>
6
+ --FILE--
7
+ <?php
8
+ require_once __DIR__ . "/../utils/basic.inc " ;
9
+ require_once __DIR__ . "/../utils/observer.php " ;
10
+
11
+ (new CommandObserver )->observe (
12
+ function () {
13
+ $ manager = new MongoDB \Driver \Manager (REPLICASET );
14
+ $ session = $ manager ->startSession ();
15
+
16
+ $ query = new MongoDB \Driver \Query ([]);
17
+ $ manager ->executeQuery (NS , $ query , ['session ' => $ session ]);
18
+ $ manager ->executeQuery (NS , $ query , ['session ' => $ session ]);
19
+ },
20
+ function (stdClass $ command )
21
+ {
22
+ $ hasClusterTime = isset ($ command ->{'$clusterTime ' });
23
+ printf ("Command includes \$clusterTime: %s \n" , ($ hasClusterTime ? 'yes ' : 'no ' ));
24
+ }
25
+ );
26
+
27
+ ?>
28
+ ===DONE===
29
+ <?php exit (0 ); ?>
30
+ --EXPECT--
31
+ Command includes $clusterTime: yes
32
+ Command includes $clusterTime: yes
33
+ ===DONE===
You can’t perform that action at this time.
0 commit comments