-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test on IPFIX writer #606
Conversation
The lib is not thread safe as it uses a shared global registry without proper locks, e.g: ``` WARNING: DATA RACE Read at 0x000001fbbde8 by goroutine 28: github.com/vmware/go-ipfix/pkg/registry.GetInfoElementFromID() /home/runner/work/flowlogs-pipeline/flowlogs-pipeline/vendor/github.com/vmware/go-ipfix/pkg/registry/registry.go:112 +0x3e github.com/vmware/go-ipfix/pkg/collector.(*CollectingProcess).decodeTemplateSet() /home/runner/work/flowlogs-pipeline/flowlogs-pipeline/vendor/github.com/vmware/go-ipfix/pkg/collector/process.go:248 +0x3e8 github.com/vmware/go-ipfix/pkg/collector.(*CollectingProcess).decodePacket() /home/runner/work/flowlogs-pipeline/flowlogs-pipeline/vendor/github.com/vmware/go-ipfix/pkg/collector/process.go:203 +0x9a4 github.com/vmware/go-ipfix/pkg/collector.(*CollectingProcess).handleUDPClient.func1() /home/runner/work/flowlogs-pipeline/flowlogs-pipeline/vendor/github.com/vmware/go-ipfix/pkg/collector/udp.go:138 +0x28d Previous write at 0x000001fbbde8 by goroutine 23: github.com/vmware/go-ipfix/pkg/registry.LoadRegistry() /home/runner/work/flowlogs-pipeline/flowlogs-pipeline/vendor/github.com/vmware/go-ipfix/pkg/registry/registry.go:97 +0x44 github.com/netobserv/flowlogs-pipeline/pkg/pipeline/write.NewWriteIpfix() /home/runner/work/flowlogs-pipeline/flowlogs-pipeline/pkg/pipeline/write/write_ipfix.go:472 +0xaca github.com/netobserv/flowlogs-pipeline/pkg/pipeline/write.TestEnrichedIPFIXFlow() /home/runner/work/flowlogs-pipeline/flowlogs-pipeline/pkg/pipeline/write/write_ipfix_test.go:93 +0x4e4 ```
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #606 +/- ##
==========================================
+ Coverage 66.09% 67.03% +0.93%
==========================================
Files 103 103
Lines 7509 7401 -108
==========================================
- Hits 4963 4961 -2
+ Misses 2254 2147 -107
- Partials 292 293 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jotak The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
cc @bhale , I believe this test can help you when adding more ipfix fields