• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..08-Jan-2020-

README.rstH A D08-Jan-20202.5 KiB8561

dirty-session-errors.jsonH A D08-Jan-202011.1 KiB524523

dirty-session-errors.ymlH A D08-Jan-20206.7 KiB273245

README.rst

1====================
2Driver Session Tests
3====================
4
5.. contents::
6
7----
8
9Introduction
10============
11
12The YAML and JSON files in this directory are platform-independent tests that
13drivers can use to prove their conformance to the Driver Sessions Spec. They are
14designed with the intention of sharing most test-runner code with the
15Transactions spec tests.
16
17Several prose tests, which are not easily expressed in YAML, are also presented
18in the Driver Sessions Spec. Those tests will need to be manually implemented
19by each driver.
20
21Test Format
22===========
23
24The same as the `Transactions Spec Test format
25<../../transactions/tests/README.rst#test-format>`_.
26
27Special Test Operations
28```````````````````````
29
30Certain operations that appear in the "operations" array do not correspond to
31API methods but instead represent special test operations. Such operations are
32defined on the "testRunner" object and are documented in the
33`Transactions Spec Test
34<../../transactions/tests/README.rst#special-test-operations>`_.
35Additional, session test specific operations are documented here:
36
37assertDifferentLsidOnLastTwoCommands
38~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39
40The "assertDifferentLsidOnLastTwoCommands" operation instructs the test runner
41to assert that the last two command started events from the test's MongoClient
42have different "lsid" fields. This assertion is used to ensure that dirty
43server sessions are discarded from the pool::
44
45      - name: assertDifferentLsidOnLastTwoCommands
46        object: testRunner
47
48assertSameLsidOnLastTwoCommands
49~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50
51The "assertSameLsidOnLastTwoCommands" operation instructs the test runner
52to assert that the last two command started events from the test's MongoClient
53have the same "lsid" field. This assertion is used to ensure that non-dirty
54server sessions are not discarded from the pool::
55
56      - name: assertSameLsidOnLastTwoCommands
57        object: testRunner
58
59assertSessionDirty
60~~~~~~~~~~~~~~~~~~
61
62The "assertSessionDirty" operation instructs the test runner to assert that
63the given session is marked dirty::
64
65      - name: assertSessionDirty
66        object: testRunner
67        arguments:
68          session: session0
69
70assertSessionNotDirty
71~~~~~~~~~~~~~~~~~~~~~
72
73The "assertSessionNotDirty" operation instructs the test runner to assert that
74the given session is *not* marked dirty::
75
76      - name: assertSessionNotDirty
77        object: testRunner
78        arguments:
79          session: session0
80
81Changelog
82=========
83
84:2019-05-15: Initial version.
85