...
1description: "server-selection-logging"
2
3schemaVersion: "1.13"
4
5runOnRequirements:
6 - topologies:
7 - load-balanced
8
9createEntities:
10 - client:
11 id: &client client
12 uriOptions:
13 heartbeatFrequencyMS: 500
14 observeLogMessages:
15 serverSelection: debug
16 observeEvents:
17 - serverDescriptionChangedEvent
18 - database:
19 id: &database database
20 client: *client
21 databaseName: &databaseName logging-tests
22 - collection:
23 id: &collection collection
24 database: *database
25 collectionName: &collectionName server-selection
26
27tests:
28 - description: "A successful operation - load balanced cluster"
29 operations:
30 # ensure we've discovered the entire topology before starting.
31 - name: waitForEvent
32 object: testRunner
33 arguments:
34 client: *client
35 event:
36 serverDescriptionChangedEvent:
37 newDescription:
38 type: LoadBalancer
39 count: 1
40 - name: insertOne
41 object: *collection
42 arguments:
43 document: { x : 1 }
44 expectLogMessages:
45 - client: *client
46 messages:
47 - level: debug
48 component: serverSelection
49 data:
50 message: "Server selection started"
51 selector: { $$exists: true }
52 operation: insert
53 topologyDescription: { $$exists: true }
54 - level: debug
55 component: serverSelection
56 data:
57 message: "Server selection succeeded"
58 selector: { $$exists: true }
59 operation: insert
60 topologyDescription: { $$exists: true }
View as plain text