Skip to content

Commit f950fb0

Browse files
fix: update test config to use smaller time window (#330)
1 parent 849ea8d commit f950fb0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tests/data/health-events-analyzer-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ data:
77
config.toml: |
88
[[rules]]
99
name = "MultipleRemediations"
10-
description = "Detect if multiple remediations are performed within 3 minutes on a node"
10+
description = "Detect if multiple remediations are performed within 1.5 minutes on a node"
1111
recommended_action = "CONTACT_SUPPORT"
1212
1313
stage = [
@@ -17,7 +17,7 @@ data:
1717
"$expr": {
1818
"$gte": [
1919
"$healthevent.generatedtimestamp.seconds",
20-
{"$subtract": [{"$divide": [{"$toLong": "$$NOW"}, 1000]}, 180]}
20+
{"$subtract": [{"$divide": [{"$toLong": "$$NOW"}, 1000]}, 90]}
2121
]
2222
}
2323
}
@@ -38,7 +38,7 @@ data:
3838
3939
[[rules]]
4040
name = "RepeatedXidError"
41-
description = "Detect occurrence of fatal XIDs 2 times within 3 minutes where the burst window is 10 seconds and sticky XIDs window is 20seconds"
41+
description = "Detect occurrence of fatal XIDs 2 times within 2 minutes where the burst window is 10 seconds and sticky XIDs window is 20seconds"
4242
recommended_action = "CONTACT_SUPPORT"
4343
stage = [
4444
'''
@@ -47,7 +47,7 @@ data:
4747
"$expr": {
4848
"$gte": [
4949
"$healthevent.generatedtimestamp.seconds",
50-
{"$subtract": [{"$divide": [{"$toLong": "$$NOW"}, 1000]}, 180]}
50+
{"$subtract": [{"$divide": [{"$toLong": "$$NOW"}, 1000]}, 120]}
5151
]
5252
}
5353
}

tests/health_events_analyzer_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ func TestMultipleRemediationsCompleted(t *testing.T) {
3737
var newCtx context.Context
3838
newCtx, testCtx = helpers.SetupHealthEventsAnalyzerTest(ctx, t, c, "data/health-events-analyzer-config.yaml", "health-events-analyzer-test")
3939

40+
t.Log("Waiting 90 seconds for the MultipleRemediations rule time window to complete")
41+
time.Sleep(90 * time.Second)
42+
43+
t.Log("Triggering multiple remediations cycle")
4044
client, err := c.NewClient()
4145
require.NoError(t, err)
4246
helpers.TriggerMultipleRemediationsCycle(ctx, t, client, testCtx.NodeName)

0 commit comments

Comments
 (0)