Debian Codegraph @

testdata/transactions/legacy/create-index.yml

raw symbols SCIP
1 runOn:
2 -
3 minServerVersion: "4.3.4"
4 topology: ["replicaset", "sharded"]
5
6 database_name: &database_name "transaction-tests"
7 collection_name: &collection_name "test"
8
9 data: []
10
11 tests:
12 - description: create index on a non-existing collection
13
14 operations:
15 - name: dropCollection
16 object: database
17 arguments:
18 collection: *collection_name
19 - name: startTransaction
20 object: session0
21 - name: createIndex
22 object: collection
23 arguments:
24 session: session0
25 name: &index_name "t_1"
26 keys:
27 x: 1
28 - name: assertIndexNotExists
29 object: testRunner
30 arguments:
31 database: *database_name
32 collection: *collection_name
33 index: *index_name
34 - name: commitTransaction
35 object: session0
36 - name: assertIndexExists
37 object: testRunner
38 arguments:
39 database: *database_name
40 collection: *collection_name
41 index: *index_name
42
43 expectations:
44 - command_started_event:
45 command:
46 drop: *collection_name
47 writeConcern:
48 command_name: drop
49 database_name: *database_name
50 - command_started_event:
51 command:
52 createIndexes: *collection_name
53 indexes:
54 - name: *index_name
55 key:
56 x: 1
57 lsid: session0
58 txnNumber:
59 $numberLong: "1"
60 startTransaction: true
61 autocommit: false
62 writeConcern:
63 command_name: createIndexes
64 database_name: *database_name
65 - command_started_event:
66 command:
67 commitTransaction: 1
68 lsid: session0
69 txnNumber:
70 $numberLong: "1"
71 startTransaction:
72 autocommit: false
73 writeConcern:
74 command_name: commitTransaction
75 database_name: admin
76
77 - description: create index on a collection created within the same transaction
78
79 operations:
80 - name: dropCollection
81 object: database
82 arguments:
83 collection: *collection_name
84 - name: startTransaction
85 object: session0
86 - name: createCollection
87 object: database
88 arguments:
89 session: session0
90 collection: *collection_name
91 - name: createIndex
92 object: collection
93 arguments:
94 session: session0
95 name: *index_name
96 keys:
97 x: 1
98 - name: assertIndexNotExists
99 object: testRunner
100 arguments:
101 database: *database_name
102 collection: *collection_name
103 index: *index_name
104 - name: commitTransaction
105 object: session0
106 - name: assertIndexExists
107 object: testRunner
108 arguments:
109 database: *database_name
110 collection: *collection_name
111 index: *index_name
112
113 expectations:
114 - command_started_event:
115 command:
116 drop: *collection_name
117 writeConcern:
118 command_name: drop
119 database_name: *database_name
120 - command_started_event:
121 command:
122 create: *collection_name
123 lsid: session0
124 txnNumber:
125 $numberLong: "1"
126 startTransaction: true
127 autocommit: false
128 writeConcern:
129 command_name: create
130 database_name: *database_name
131 - command_started_event:
132 command:
133 createIndexes: *collection_name
134 indexes:
135 - name: *index_name
136 key:
137 x: 1
138 lsid: session0
139 writeConcern:
140 command_name: createIndexes
141 database_name: *database_name
142 - command_started_event:
143 command:
144 commitTransaction: 1
145 lsid: session0
146 txnNumber:
147 $numberLong: "1"
148 startTransaction:
149 autocommit: false
150 writeConcern:
151 command_name: commitTransaction
152 database_name: admin