File: poc-command-monitoring.yml

package info (click to toggle)
golang-mongodb-mongo-driver 1.8.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 18,500 kB
  • sloc: perl: 533; ansic: 491; python: 432; makefile: 187; sh: 72
file content (102 lines) | stat: -rw-r--r-- 2,941 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
description: "poc-command-monitoring"

schemaVersion: "1.0"

createEntities:
  - client:
      id: &client0 client0
      observeEvents:
        - commandStartedEvent
        - commandSucceededEvent
        - commandFailedEvent
  - database:
      id: &database0 database0
      client: *client0
      databaseName: &database0Name command-monitoring-tests
  - collection:
      id: &collection0 collection0
      database: *database0
      collectionName: &collection0Name test

initialData:
  - collectionName: *collection0Name
    databaseName: *database0Name
    documents:
      - { _id: 1, x: 11 }
      - { _id: 2, x: 22 }
      - { _id: 3, x: 33 }
      - { _id: 4, x: 44 }
      - { _id: 5, x: 55 }

tests:
  - description: "A successful find event with a getmore and the server kills the cursor (<= 4.4)"
    runOnRequirements:
      - minServerVersion: "3.1"
        maxServerVersion: "4.4.99"
        topologies: [ single, replicaset ]
    operations:
      - name: find
        object: *collection0
        arguments:
          filter: { _id: { $gte: 1 }}
          sort: { _id: 1 }
          batchSize: 3
          limit: 4
    expectEvents:
      - client: *client0
        events:
          - commandStartedEvent:
              command:
                find: *collection0Name
                filter: { _id: { $gte : 1 } }
                sort: { _id: 1 }
                batchSize: 3
                limit: 4
              commandName: find
              databaseName: *database0Name
          - commandSucceededEvent:
              reply:
                ok: 1
                cursor:
                  id: { $$type: [ int, long ] }
                  ns: &namespace command-monitoring-tests.test
                  firstBatch:
                    - { _id: 1, x: 11 }
                    - { _id: 2, x: 22 }
                    - { _id: 3, x: 33 }
              commandName: find
          - commandStartedEvent:
              command:
                getMore: { $$type: [ int, long ] }
                collection: *collection0Name
                batchSize: 1
              commandName: getMore
              databaseName: *database0Name
          - commandSucceededEvent:
              reply:
                ok: 1
                cursor:
                  id: 0
                  ns: *namespace
                  nextBatch:
                    - { _id: 4, x: 44 }
              commandName: getMore

  - description: "A failed find event"
    operations:
      - name: find
        object: *collection0
        arguments:
          filter: { $or: true }
        expectError: { isError: true }
    expectEvents:
      - client: *client0
        events:
          - commandStartedEvent:
              command:
                find: *collection0Name
                filter: { $or: true }
              commandName: find
              databaseName: *database0Name
          - commandFailedEvent:
              commandName: find