Skip to content
Snippets Groups Projects
Commit e431fe4d authored by Nikolay Stanchev's avatar Nikolay Stanchev
Browse files

Fixes broken alerts integration test

parent d638b408
No related branches found
No related tags found
No related merge requests found
......@@ -23,9 +23,14 @@ var current = batch
|query('SELECT ' + influxFunction + '(' + field + ') AS value FROM "' + db + '"."' + rp + '"."' + measurement + '" WHERE ' + whereClause)
.period(alertPeriod)
.every(alertPeriod)
.align()
var past = current
.offset(alertPeriod)
var past = batch
|query('SELECT ' + influxFunction + '(' + field + ') AS value FROM "' + db + '"."' + rp + '"."' + measurement + '" WHERE ' + whereClause)
.period(alertPeriod)
.every(alertPeriod)
.offset(alertPeriod)
.align()
| shift(alertPeriod)
past
......
......@@ -77,11 +77,12 @@ class TestAlerts(object):
sleep(10)
print("Sending test requests to nginx...")
for i in range(20):
for i in range(40):
response = get("http://{0}:{1}/".format(nginx_host, NGINX_PORT))
assert response.status_code == 200
sleep(0.25)
print("Wait 20 seconds for Kapacitor to trigger alerts...")
sleep(20)
print("Wait 15 seconds for Kapacitor to trigger alerts...")
sleep(15)
assert len(listdir(LOG_TEST_FOLDER_PATH)) == 4, "4 log files must have been created - one for each alert defined in the specification."
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment