| 1 | { |
| 2 | "description": "replicaset-logging", |
| 3 | "schemaVersion": "1.16", |
| 4 | "runOnRequirements": [ |
| 5 | { |
| 6 | "topologies": [ |
| 7 | "replicaset" |
| 8 | ], |
| 9 | "minServerVersion": "4.4" |
| 10 | } |
| 11 | ], |
| 12 | "createEntities": [ |
| 13 | { |
| 14 | "client": { |
| 15 | "id": "setupClient" |
| 16 | } |
| 17 | } |
| 18 | ], |
| 19 | "tests": [ |
| 20 | { |
| 21 | "description": "Topology lifecycle", |
| 22 | "operations": [ |
| 23 | { |
| 24 | "name": "createEntities", |
| 25 | "object": "testRunner", |
| 26 | "arguments": { |
| 27 | "entities": [ |
| 28 | { |
| 29 | "client": { |
| 30 | "id": "client", |
| 31 | "observeLogMessages": { |
| 32 | "topology": "debug" |
| 33 | }, |
| 34 | "observeEvents": [ |
| 35 | "topologyDescriptionChangedEvent" |
| 36 | ] |
| 37 | } |
| 38 | } |
| 39 | ] |
| 40 | } |
| 41 | }, |
| 42 | { |
| 43 | "name": "waitForEvent", |
| 44 | "object": "testRunner", |
| 45 | "arguments": { |
| 46 | "client": "client", |
| 47 | "event": { |
| 48 | "topologyDescriptionChangedEvent": {} |
| 49 | }, |
| 50 | "count": 4 |
| 51 | } |
| 52 | }, |
| 53 | { |
| 54 | "name": "close", |
| 55 | "object": "client" |
| 56 | } |
| 57 | ], |
| 58 | "expectLogMessages": [ |
| 59 | { |
| 60 | "client": "client", |
| 61 | "ignoreMessages": [ |
| 62 | { |
| 63 | "level": "debug", |
| 64 | "component": "topology", |
| 65 | "data": { |
| 66 | "message": "Starting server monitoring" |
| 67 | } |
| 68 | }, |
| 69 | { |
| 70 | "level": "debug", |
| 71 | "component": "topology", |
| 72 | "data": { |
| 73 | "message": "Server heartbeat started" |
| 74 | } |
| 75 | }, |
| 76 | { |
| 77 | "level": "debug", |
| 78 | "component": "topology", |
| 79 | "data": { |
| 80 | "message": "Server heartbeat succeeded" |
| 81 | } |
| 82 | }, |
| 83 | { |
| 84 | "level": "debug", |
| 85 | "component": "topology", |
| 86 | "data": { |
| 87 | "message": "Server heartbeat failed" |
| 88 | } |
| 89 | } |
| 90 | ], |
| 91 | "messages": [ |
| 92 | { |
| 93 | "level": "debug", |
| 94 | "component": "topology", |
| 95 | "data": { |
| 96 | "message": "Starting topology monitoring", |
| 97 | "topologyId": { |
| 98 | "$$exists": true |
| 99 | } |
| 100 | } |
| 101 | }, |
| 102 | { |
| 103 | "level": "debug", |
| 104 | "component": "topology", |
| 105 | "data": { |
| 106 | "message": "Topology description changed", |
| 107 | "topologyId": { |
| 108 | "$$exists": true |
| 109 | }, |
| 110 | "previousDescription": { |
| 111 | "$$exists": true |
| 112 | }, |
| 113 | "newDescription": { |
| 114 | "$$exists": true |
| 115 | } |
| 116 | } |
| 117 | }, |
| 118 | { |
| 119 | "level": "debug", |
| 120 | "component": "topology", |
| 121 | "data": { |
| 122 | "message": "Topology description changed", |
| 123 | "topologyId": { |
| 124 | "$$exists": true |
| 125 | }, |
| 126 | "previousDescription": { |
| 127 | "$$exists": true |
| 128 | }, |
| 129 | "newDescription": { |
| 130 | "$$exists": true |
| 131 | } |
| 132 | } |
| 133 | }, |
| 134 | { |
| 135 | "level": "debug", |
| 136 | "component": "topology", |
| 137 | "data": { |
| 138 | "message": "Topology description changed", |
| 139 | "topologyId": { |
| 140 | "$$exists": true |
| 141 | }, |
| 142 | "previousDescription": { |
| 143 | "$$exists": true |
| 144 | }, |
| 145 | "newDescription": { |
| 146 | "$$exists": true |
| 147 | } |
| 148 | } |
| 149 | }, |
| 150 | { |
| 151 | "level": "debug", |
| 152 | "component": "topology", |
| 153 | "data": { |
| 154 | "message": "Topology description changed", |
| 155 | "topologyId": { |
| 156 | "$$exists": true |
| 157 | }, |
| 158 | "previousDescription": { |
| 159 | "$$exists": true |
| 160 | }, |
| 161 | "newDescription": { |
| 162 | "$$exists": true |
| 163 | } |
| 164 | } |
| 165 | }, |
| 166 | { |
| 167 | "level": "debug", |
| 168 | "component": "topology", |
| 169 | "data": { |
| 170 | "message": "Stopped server monitoring", |
| 171 | "topologyId": { |
| 172 | "$$exists": true |
| 173 | }, |
| 174 | "serverHost": { |
| 175 | "$$type": "string" |
| 176 | }, |
| 177 | "serverPort": { |
| 178 | "$$type": [ |
| 179 | "int", |
| 180 | "long" |
| 181 | ] |
| 182 | } |
| 183 | } |
| 184 | }, |
| 185 | { |
| 186 | "level": "debug", |
| 187 | "component": "topology", |
| 188 | "data": { |
| 189 | "message": "Stopped server monitoring", |
| 190 | "topologyId": { |
| 191 | "$$exists": true |
| 192 | }, |
| 193 | "serverHost": { |
| 194 | "$$type": "string" |
| 195 | }, |
| 196 | "serverPort": { |
| 197 | "$$type": [ |
| 198 | "int", |
| 199 | "long" |
| 200 | ] |
| 201 | } |
| 202 | } |
| 203 | }, |
| 204 | { |
| 205 | "level": "debug", |
| 206 | "component": "topology", |
| 207 | "data": { |
| 208 | "message": "Stopped server monitoring", |
| 209 | "topologyId": { |
| 210 | "$$exists": true |
| 211 | }, |
| 212 | "serverHost": { |
| 213 | "$$type": "string" |
| 214 | }, |
| 215 | "serverPort": { |
| 216 | "$$type": [ |
| 217 | "int", |
| 218 | "long" |
| 219 | ] |
| 220 | } |
| 221 | } |
| 222 | }, |
| 223 | { |
| 224 | "level": "debug", |
| 225 | "component": "topology", |
| 226 | "data": { |
| 227 | "message": "Stopped topology monitoring", |
| 228 | "topologyId": { |
| 229 | "$$exists": true |
| 230 | } |
| 231 | } |
| 232 | } |
| 233 | ] |
| 234 | } |
| 235 | ] |
| 236 | }, |
| 237 | { |
| 238 | "description": "Successful heartbeat", |
| 239 | "operations": [ |
| 240 | { |
| 241 | "name": "createEntities", |
| 242 | "object": "testRunner", |
| 243 | "arguments": { |
| 244 | "entities": [ |
| 245 | { |
| 246 | "client": { |
| 247 | "id": "client", |
| 248 | "observeLogMessages": { |
| 249 | "topology": "debug" |
| 250 | }, |
| 251 | "observeEvents": [ |
| 252 | "serverHeartbeatSucceededEvent" |
| 253 | ] |
| 254 | } |
| 255 | } |
| 256 | ] |
| 257 | } |
| 258 | }, |
| 259 | { |
| 260 | "name": "waitForEvent", |
| 261 | "object": "testRunner", |
| 262 | "arguments": { |
| 263 | "client": "client", |
| 264 | "event": { |
| 265 | "serverHeartbeatSucceededEvent": {} |
| 266 | }, |
| 267 | "count": 3 |
| 268 | } |
| 269 | } |
| 270 | ], |
| 271 | "expectLogMessages": [ |
| 272 | { |
| 273 | "client": "client", |
| 274 | "ignoreExtraMessages": true, |
| 275 | "ignoreMessages": [ |
| 276 | { |
| 277 | "level": "debug", |
| 278 | "component": "topology", |
| 279 | "data": { |
| 280 | "message": "Server heartbeat started" |
| 281 | } |
| 282 | }, |
| 283 | { |
| 284 | "level": "debug", |
| 285 | "component": "topology", |
| 286 | "data": { |
| 287 | "message": "Starting server monitoring" |
| 288 | } |
| 289 | }, |
| 290 | { |
| 291 | "level": "debug", |
| 292 | "component": "topology", |
| 293 | "data": { |
| 294 | "message": "Stopped server monitoring" |
| 295 | } |
| 296 | }, |
| 297 | { |
| 298 | "level": "debug", |
| 299 | "component": "topology", |
| 300 | "data": { |
| 301 | "message": "Topology description changed" |
| 302 | } |
| 303 | } |
| 304 | ], |
| 305 | "messages": [ |
| 306 | { |
| 307 | "level": "debug", |
| 308 | "component": "topology", |
| 309 | "data": { |
| 310 | "message": "Starting topology monitoring", |
| 311 | "topologyId": { |
| 312 | "$$exists": true |
| 313 | } |
| 314 | } |
| 315 | }, |
| 316 | { |
| 317 | "level": "debug", |
| 318 | "component": "topology", |
| 319 | "data": { |
| 320 | "message": "Server heartbeat succeeded", |
| 321 | "awaited": { |
| 322 | "$$exists": true |
| 323 | }, |
| 324 | "topologyId": { |
| 325 | "$$exists": true |
| 326 | }, |
| 327 | "serverHost": { |
| 328 | "$$type": "string" |
| 329 | }, |
| 330 | "serverPort": { |
| 331 | "$$type": [ |
| 332 | "int", |
| 333 | "long" |
| 334 | ] |
| 335 | }, |
| 336 | "driverConnectionId": { |
| 337 | "$$exists": true |
| 338 | }, |
| 339 | "serverConnectionId": { |
| 340 | "$$exists": true |
| 341 | }, |
| 342 | "durationMS": { |
| 343 | "$$type": [ |
| 344 | "int", |
| 345 | "long" |
| 346 | ] |
| 347 | }, |
| 348 | "reply": { |
| 349 | "$$matchAsDocument": { |
| 350 | "$$matchAsRoot": { |
| 351 | "ok": 1 |
| 352 | } |
| 353 | } |
| 354 | } |
| 355 | } |
| 356 | }, |
| 357 | { |
| 358 | "level": "debug", |
| 359 | "component": "topology", |
| 360 | "data": { |
| 361 | "message": "Server heartbeat succeeded", |
| 362 | "awaited": { |
| 363 | "$$exists": true |
| 364 | }, |
| 365 | "topologyId": { |
| 366 | "$$exists": true |
| 367 | }, |
| 368 | "serverHost": { |
| 369 | "$$type": "string" |
| 370 | }, |
| 371 | "serverPort": { |
| 372 | "$$type": [ |
| 373 | "int", |
| 374 | "long" |
| 375 | ] |
| 376 | }, |
| 377 | "driverConnectionId": { |
| 378 | "$$exists": true |
| 379 | }, |
| 380 | "serverConnectionId": { |
| 381 | "$$exists": true |
| 382 | }, |
| 383 | "durationMS": { |
| 384 | "$$type": [ |
| 385 | "int", |
| 386 | "long" |
| 387 | ] |
| 388 | }, |
| 389 | "reply": { |
| 390 | "$$matchAsDocument": { |
| 391 | "$$matchAsRoot": { |
| 392 | "ok": 1 |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | } |
| 397 | }, |
| 398 | { |
| 399 | "level": "debug", |
| 400 | "component": "topology", |
| 401 | "data": { |
| 402 | "message": "Server heartbeat succeeded", |
| 403 | "awaited": { |
| 404 | "$$exists": true |
| 405 | }, |
| 406 | "topologyId": { |
| 407 | "$$exists": true |
| 408 | }, |
| 409 | "serverHost": { |
| 410 | "$$type": "string" |
| 411 | }, |
| 412 | "serverPort": { |
| 413 | "$$type": [ |
| 414 | "int", |
| 415 | "long" |
| 416 | ] |
| 417 | }, |
| 418 | "driverConnectionId": { |
| 419 | "$$exists": true |
| 420 | }, |
| 421 | "serverConnectionId": { |
| 422 | "$$exists": true |
| 423 | }, |
| 424 | "durationMS": { |
| 425 | "$$type": [ |
| 426 | "int", |
| 427 | "long" |
| 428 | ] |
| 429 | }, |
| 430 | "reply": { |
| 431 | "$$matchAsDocument": { |
| 432 | "$$matchAsRoot": { |
| 433 | "ok": 1 |
| 434 | } |
| 435 | } |
| 436 | } |
| 437 | } |
| 438 | } |
| 439 | ] |
| 440 | } |
| 441 | ] |
| 442 | }, |
| 443 | { |
| 444 | "description": "Failing heartbeat", |
| 445 | "operations": [ |
| 446 | { |
| 447 | "name": "createEntities", |
| 448 | "object": "testRunner", |
| 449 | "arguments": { |
| 450 | "entities": [ |
| 451 | { |
| 452 | "client": { |
| 453 | "id": "client", |
| 454 | "observeLogMessages": { |
| 455 | "topology": "debug" |
| 456 | }, |
| 457 | "observeEvents": [ |
| 458 | "serverHeartbeatFailedEvent" |
| 459 | ], |
| 460 | "uriOptions": { |
| 461 | "appname": "failingHeartbeatLoggingTest" |
| 462 | } |
| 463 | } |
| 464 | } |
| 465 | ] |
| 466 | } |
| 467 | }, |
| 468 | { |
| 469 | "name": "failPoint", |
| 470 | "object": "testRunner", |
| 471 | "arguments": { |
| 472 | "failPoint": { |
| 473 | "configureFailPoint": "failCommand", |
| 474 | "mode": "alwaysOn", |
| 475 | "data": { |
| 476 | "failCommands": [ |
| 477 | "hello", |
| 478 | "isMaster" |
| 479 | ], |
| 480 | "appName": "failingHeartbeatLoggingTest", |
| 481 | "closeConnection": true |
| 482 | } |
| 483 | }, |
| 484 | "client": "setupClient" |
| 485 | } |
| 486 | }, |
| 487 | { |
| 488 | "name": "waitForEvent", |
| 489 | "object": "testRunner", |
| 490 | "arguments": { |
| 491 | "client": "client", |
| 492 | "event": { |
| 493 | "serverHeartbeatFailedEvent": {} |
| 494 | }, |
| 495 | "count": 1 |
| 496 | } |
| 497 | } |
| 498 | ], |
| 499 | "expectLogMessages": [ |
| 500 | { |
| 501 | "client": "client", |
| 502 | "ignoreExtraMessages": true, |
| 503 | "ignoreMessages": [ |
| 504 | { |
| 505 | "level": "debug", |
| 506 | "component": "topology", |
| 507 | "data": { |
| 508 | "message": "Server heartbeat started" |
| 509 | } |
| 510 | }, |
| 511 | { |
| 512 | "level": "debug", |
| 513 | "component": "topology", |
| 514 | "data": { |
| 515 | "message": "Server heartbeat succeeded" |
| 516 | } |
| 517 | }, |
| 518 | { |
| 519 | "level": "debug", |
| 520 | "component": "topology", |
| 521 | "data": { |
| 522 | "message": "Starting server monitoring" |
| 523 | } |
| 524 | }, |
| 525 | { |
| 526 | "level": "debug", |
| 527 | "component": "topology", |
| 528 | "data": { |
| 529 | "message": "Stopped server monitoring" |
| 530 | } |
| 531 | }, |
| 532 | { |
| 533 | "level": "debug", |
| 534 | "component": "topology", |
| 535 | "data": { |
| 536 | "message": "Topology description changed" |
| 537 | } |
| 538 | } |
| 539 | ], |
| 540 | "messages": [ |
| 541 | { |
| 542 | "level": "debug", |
| 543 | "component": "topology", |
| 544 | "data": { |
| 545 | "message": "Starting topology monitoring", |
| 546 | "topologyId": { |
| 547 | "$$exists": true |
| 548 | } |
| 549 | } |
| 550 | }, |
| 551 | { |
| 552 | "level": "debug", |
| 553 | "component": "topology", |
| 554 | "data": { |
| 555 | "message": "Server heartbeat failed", |
| 556 | "awaited": { |
| 557 | "$$exists": true |
| 558 | }, |
| 559 | "topologyId": { |
| 560 | "$$exists": true |
| 561 | }, |
| 562 | "serverHost": { |
| 563 | "$$type": "string" |
| 564 | }, |
| 565 | "serverPort": { |
| 566 | "$$type": [ |
| 567 | "int", |
| 568 | "long" |
| 569 | ] |
| 570 | }, |
| 571 | "driverConnectionId": { |
| 572 | "$$exists": true |
| 573 | }, |
| 574 | "durationMS": { |
| 575 | "$$type": [ |
| 576 | "int", |
| 577 | "long" |
| 578 | ] |
| 579 | }, |
| 580 | "failure": { |
| 581 | "$$exists": true |
| 582 | } |
| 583 | } |
| 584 | } |
| 585 | ] |
| 586 | } |
| 587 | ] |
| 588 | } |
| 589 | ] |
| 590 | } |