tests: runtime: isolate Loki mock server configuration#12132
Open
edsiper wants to merge 1 commit into
Open
Conversation
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Loki runtime test mock server now owns its ChangesTenant policy server lifecycle
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
flb_configRoot cause
The runtime test started Fluent Bit and then registered the mock HTTP server downstream in
ctx->config. The mock server event-loop thread modified downstream connection and destruction queues while the engine thread iterated and processed the same structures. Helgrind therefore reported races in downstream setup, timeout processing, connection release, and pending destruction.This is a test-fixture ownership issue, not a Loki plugin or allocator bug.
Lifecycle
The mock fixture now:
flb_config_exit()only after mock activity has endedInitialization state is tracked so every failure path releases only initialized resources.
Validation
cmake -S . -B build -DFLB_TESTS_RUNTIME=On -DFLB_TESTS_INTERNAL=Oncmake --build build -j8ctest --test-dir build -R '^flb-rt-out_loki$' --output-on-failure— passedbuild/bin/flb-rt-out_loki tenant_id_key_splits_requests tenant_id_key_partial_success tenant_id_key_partial_error— passedtenant_id_key_splits_requestsrepeated 30 times — 30/30 passedlibp11-kitreportsFLB_JEMALLOC=On— built andflb-rt-out_lokipassedNo production code or bundled library code is changed.
Summary by CodeRabbit