tests: runtime: Fix errors of incompatible types for in_ebpf tests - #12337
tests: runtime: Fix errors of incompatible types for in_ebpf tests#12337cosmo0920 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe runtime tests now match the current event data layouts. The exec test checks ChangesRuntime decoding tests
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change corrects incompatible types in runtime tests without changing production behavior, and the affected tests compile and pass; no actionable merge-blocking risk remains beyond normal checks. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
7c2a125 to
6047af9
Compare
This error was occurred in Ubuntu 26.04 (Resolute Raccoon).
Ubuntu Reolute's gcc is now gcc-15!!!
Summary
Two compile errors in the
in_ebpfruntime tests, both type mismatches against the plugin's event structs. Both fixed and verified.1.
strlenon a 2D array — tests/runtime/in_ebpf_exec_handler.c:144struct execve_event.argvischar argv[EXECVE_ARG_MAX][EXECVE_ARG_LEN]plugins/in_ebpf/traces/includes/common/events.h:71, so bare.argvdecays tochar (*)[256], notchar *. The adjacentstrncmpalready indexedargv[0]; only thestrlenwas missing it.2. Wrong struct passed to
encode_sched_event— tests/runtime/in_ebpf_sched_handler.c, tests/runtime/in_ebpf_sched_handler.cThe sched handler takes the compact
struct sched_sampleplugins/in_ebpf/traces/includes/common/events.h — flat{type, common, sched_event details}— not the tagged-unionstruct event. Switched the test tosched_sample, which also meantdetails.sched.X→details.X:verify_decoded_valuessignature (line 89)test_eventdeclaration +memsetsize (lines 123, 129)Verification
Swept all seven
in_ebpf_*_handlertests for the same mismatch class rather than just the two reported. All compile clean and pass:Left alone:
-Wdiscarded-qualifierswarnings at handler.c, plugins/in_ebpf/traces/exec/handler.c —flb_log_event_encoder_append_cstringtakeschar *while the handler passesconst char *. Pre-existing, warnings only, unrelated to either error.Enter
[N/A]in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-testlabel to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit