testMonitorSendClusterThroughputSpike fix
@@ -112,23 +112,18 @@ def testNodeSendNodeRequestSpike(pluginManagerWithImportedModules, testNode):
def testMonitorSendClusterThroughputSpike(pluginManagerWithImportedModules,
- testNode, monkeypatch):
- throughput = 1
+ testNode):
+ testNode.monitor.clusterThroughputSpikeMonitorData['accum'] = [1]
- def mockGetThroughput(*args):
- nonlocal throughput
- return throughput
-
- monkeypatch.setattr(testNode.monitor, 'getThroughput', mockGetThroughput)
testNode.monitor.notifierEventTriggeringConfig['clusterThroughputSpike'] = {
'coefficient': 3,
'minCnt': 1,
'freq': 60
}
assert testNode.monitor.sendClusterThroughputSpike() is None
- throughput = 2
+ testNode.monitor.clusterThroughputSpikeMonitorData['accum'] = [2]
assert testNode.monitor.sendClusterThroughputSpike() is None
- throughput = 4.5
+ testNode.monitor.clusterThroughputSpikeMonitorData['accum'] = [4.6]
sent, found = testNode.monitor.sendClusterThroughputSpike()
assert sent == 3
