Commit 3f3241e8 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

many promises: fix anomaly not returning AnomalyResult

Also add a comment when we really don't want an AnomalyResult.

See merge request !137
parent 19ba0594
Pipeline #38629 failed with stage
in 0 seconds
...@@ -81,4 +81,4 @@ class RunPromise(GenericPromise): ...@@ -81,4 +81,4 @@ class RunPromise(GenericPromise):
def anomaly(self): def anomaly(self):
# only check the result of the two latest sense call # only check the result of the two latest sense call
return self._test(result_count=2, failure_amount=2, latest_minute=self.custom_frequency*3) return self._anomaly(result_count=2, failure_amount=2, latest_minute=self.custom_frequency*3)
...@@ -52,4 +52,4 @@ class RunPromise(GenericPromise): ...@@ -52,4 +52,4 @@ class RunPromise(GenericPromise):
return self._test(result_count=1, failure_amount=1) return self._test(result_count=1, failure_amount=1)
def anomaly(self): def anomaly(self):
return self._test(result_count=3, failure_amount=3) return self._anomaly(result_count=3, failure_amount=3)
...@@ -364,4 +364,10 @@ class RunPromise(GenericPromise): ...@@ -364,4 +364,10 @@ class RunPromise(GenericPromise):
return self._test(result_count=1, failure_amount=1) return self._test(result_count=1, failure_amount=1)
def anomaly(self): def anomaly(self):
return self._test(result_count=3, failure_amount=3) """
\ No newline at end of file Anomaly returns a TestResult instead of AnomalyResult because we don't
want to call bang when there is a problem. Usually the problem won't be
in the deployment of this instance but rather in one of the partition
taking too much space. This will need a human intervention.
"""
return self._test(result_count=3, failure_amount=3)
...@@ -45,4 +45,4 @@ class RunPromise(GenericPromise): ...@@ -45,4 +45,4 @@ class RunPromise(GenericPromise):
def anomaly(self): def anomaly(self):
# only check the result of the two latest sense call # only check the result of the two latest sense call
return self._test(result_count=2, failure_amount=2, latest_minute=self.custom_frequency*3) return self._anomaly(result_count=2, failure_amount=2, latest_minute=self.custom_frequency*3)
...@@ -48,4 +48,4 @@ class RunPromise(GenericPromise): ...@@ -48,4 +48,4 @@ class RunPromise(GenericPromise):
return self._test(result_count=1, failure_amount=1) return self._test(result_count=1, failure_amount=1)
def anomaly(self): def anomaly(self):
return self._test(result_count=2, failure_amount=2) return self._anomaly(result_count=2, failure_amount=2)
...@@ -63,4 +63,4 @@ class RunPromise(GenericPromise): ...@@ -63,4 +63,4 @@ class RunPromise(GenericPromise):
def anomaly(self): def anomaly(self):
# only check the result of the two latest sense call # only check the result of the two latest sense call
return self._test(result_count=2, failure_amount=2, latest_minute=self.custom_frequency*3) return self._anomaly(result_count=2, failure_amount=2, latest_minute=self.custom_frequency*3)
...@@ -52,5 +52,11 @@ class RunPromise(GenericPromise): ...@@ -52,5 +52,11 @@ class RunPromise(GenericPromise):
return self._test(result_count=10, failure_amount=10) return self._test(result_count=10, failure_amount=10)
def anomaly(self): def anomaly(self):
# fail if load is higher than the threshold for more than 30 minutes """
Anomaly returns a TestResult instead of AnomalyResult because we don't
want to call bang when there is a problem of load.
This will need a human intervention to find where the load come from.
We fail if load is higher than the threshold for more than 30 minutes.
"""
return self._test(result_count=10, failure_amount=10) return self._test(result_count=10, failure_amount=10)
...@@ -395,5 +395,10 @@ class RunPromise(GenericPromise): ...@@ -395,5 +395,10 @@ class RunPromise(GenericPromise):
self.emitLog() self.emitLog()
def anomaly(self): def anomaly(self):
"""
Anomaly returns a TestResult instead of AnomalyResult because we don't
want to call bang when there is a problem.
This will need a human intervention.
"""
return self._test( return self._test(
result_count=self.result_count, failure_amount=self.failure_amount) result_count=self.result_count, failure_amount=self.failure_amount)
...@@ -117,4 +117,4 @@ class RunPromise(GenericPromise): ...@@ -117,4 +117,4 @@ class RunPromise(GenericPromise):
log("%s request to %r %s (%s)", request_type, url, result, message) log("%s request to %r %s (%s)", request_type, url, result, message)
def anomaly(self): def anomaly(self):
return self._test(result_count=3, failure_amount=3) return self._anomaly(result_count=3, failure_amount=3)
...@@ -73,4 +73,4 @@ class RunPromise(GenericPromise): ...@@ -73,4 +73,4 @@ class RunPromise(GenericPromise):
ws.close() ws.close()
def anomaly(self): def anomaly(self):
return self._test(result_count=3, failure_amount=3) return self._anomaly(result_count=3, failure_amount=3)
...@@ -236,4 +236,10 @@ class RunPromise(GenericPromise): ...@@ -236,4 +236,10 @@ class RunPromise(GenericPromise):
return self._test(result_count=1, failure_amount=1) return self._test(result_count=1, failure_amount=1)
def anomaly(self): def anomaly(self):
"""
Anomaly returns a TestResult instead of AnomalyResult because we don't
want to call bang when there is a problem. Usually the problem won't be
in the deployment of this instance but rather in this partition taking
too much space. This will need a human intervention.
"""
return self._test(result_count=3, failure_amount=3) return self._test(result_count=3, failure_amount=3)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment