diff options
author | Andrew Shuvalov <andrew.shuvalov@mongodb.com> | 2022-01-10 21:41:36 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-11 14:57:42 +0000 |
commit | e3c2d10228bcb64fbf0bc26e9c8468e47fa3677e (patch) | |
tree | c3dcd5486b3e535379185406b84614d0a4d659e8 /jstests | |
parent | e46858249a8449e9589bbb926ad367d092d71acc (diff) | |
download | mongo-e3c2d10228bcb64fbf0bc26e9c8468e47fa3677e.tar.gz |
SERVER-59375 SERVER-62373 additional serverStatus sections for health checks
(cherry picked from commit 386986a651b852c3c98b426ea60a023d99e4a5a4)
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/sharding/health_monitor/non_critical_facet.js | 3 | ||||
-rw-r--r-- | jstests/sharding/health_monitor/server_status_health.js | 18 |
2 files changed, 16 insertions, 5 deletions
diff --git a/jstests/sharding/health_monitor/non_critical_facet.js b/jstests/sharding/health_monitor/non_critical_facet.js index 6bedf771242..704f924c83b 100644 --- a/jstests/sharding/health_monitor/non_critical_facet.js +++ b/jstests/sharding/health_monitor/non_critical_facet.js @@ -49,8 +49,7 @@ sleep(ACTIVE_FAULT_DURATION_SECS * 2000); // Still in transient fault. result = assert.commandWorked(st.s0.adminCommand({serverStatus: 1})).health; assert.eq(result.state, "TransientFault"); -assert( - result.faultInformation.facets.kTestObserver.description.includes("InternalError: test msg")); +assert(result.faultInformation.facets.testObserver.description.includes("InternalError: test msg")); st.stop(); })(); diff --git a/jstests/sharding/health_monitor/server_status_health.js b/jstests/sharding/health_monitor/server_status_health.js index 6a146d87eba..09e9b74390b 100644 --- a/jstests/sharding/health_monitor/server_status_health.js +++ b/jstests/sharding/health_monitor/server_status_health.js @@ -56,15 +56,16 @@ print("---RESULT 2---"); print(tojson(result)); assert(result.enteredStateAtTime); assert(result.faultInformation); +assert(result.testObserver.intensity); const faultInformation = result.faultInformation; assert.eq(faultInformation.severity, 1); assert(faultInformation.duration); assert(faultInformation.facets); assert.eq(faultInformation.numFacets, 1); -assert(faultInformation.facets.kTestObserver); +assert(faultInformation.facets.testObserver); -const kTestObserverFacet = faultInformation.facets.kTestObserver; +const kTestObserverFacet = faultInformation.facets.testObserver; assert.eq(kTestObserverFacet.severity, faultInformation.severity); assert.eq(kTestObserverFacet.duration, faultInformation.duration); assert(kTestObserverFacet.description.includes("InternalError: test msg")); @@ -78,11 +79,22 @@ assert.soon(() => { return result.state == "Ok"; }); -result = assert.commandWorked(st.s0.adminCommand({serverStatus: 1})).health; print("---RESULT 3---"); +result = assert.commandWorked(st.s0.adminCommand({serverStatus: 1})).health; print(tojson(result)); assert.eq(result.state, "Ok"); assert(result.enteredStateAtTime); +print("---RESULT 4 with details---"); +result = + assert.commandWorked(st.s0.adminCommand({serverStatus: 1, health: {details: true}})).health; +print(tojson(result)); +const testObserver = result.testObserver; +assert(testObserver.totalChecks); +assert(testObserver.totalChecks >= 1); +assert(testObserver.totalChecksWithFailure >= 1); +assert(testObserver.timeSinceLastCheckStartedMs >= 1); +assert(testObserver.timeSinceLastCheckCompletedMs >= 1); + st.stop(); })(); |