influxdata / influxdata/kapacitor
Fix TestServer_Alert_Aggregate
- Dominant language
- Go
- Stars
- 2.4k
- Forks
- 479
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 4
Description
```
--- FAIL: TestServer_Alert_Aggregate (1.18s)
server_test.go:8749: unexpected tcp request:
exp
[{ID:id-agg Message:Received 3 events in the last 100ms. Details:message
message
message Time:1970-01-01 00:00:00.002 +0000 UTC Duration:2ms Level:CRITICAL Data:{"series":[{"name":"alert","columns":["time","value"],"values":[["1970-01-01T00:00:00Z",3]]},{"name":"alert","columns":["time","value"],"values":[["1970-01-01T00:00:00.001Z",4]]},{"name":"alert","columns":["time","value"],"values":[["1970-01-01T00:00:00.002Z",2]]}]}}]
got
[{ID:id-agg Message:Received 1 events in the last 100ms. Details:message Time:1970-01-01 00:00:00 +0000 UTC Duration:0s Level:CRITICAL Data:{"series":[{"name":"alert","columns":["time","value"],"values":[["1970-01-01T00:00:00Z",3]]}]}}]
server_test.go:8775: unexpected topic events for aggregate topic:
got
{Link:{Relation:self Href:/kapacitor/v1preview/alerts/topics/tcp/events} Topic:tcp Events:[{Link:{Relation:self Href:/kapacitor/v1preview/alerts/topics/tcp/events/id-agg} ID:id-agg State:{Message:Received 1 events in the last 100ms. Details:message Time:1970-01-01 00:00:00 +0000 UTC Duration:0 Level:CRITICAL}}]}
exp
{Link:{Relation:self Href:/kapacitor/v1preview/alerts/topics/tcp/events} Topic:tcp Events:[{Link:{Relation:self Href:/kapacitor/v1preview/alerts/topics/tcp/events/id-agg} ID:id-agg State:{Message:Received 3 events in the last 100ms. Details:message
message
message Time:1970-01-01 00:00:00.002 +0000 UTC Duration:2000000 Level:CRITICAL}}]}
```
Contributor guide
Research direction
Start with server_test.go around lines 8749 and 8775, where TestServer_Alert_Aggregate reports the unexpected TCP request and aggregate topic events. Run this test to reproduce the failure and inspect the expected versus actual aggregate state. Done means the test passes with all three events represented in the aggregate message and topic event.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100