Skip to content

tests: runtime: out_http: push JSON format records together - #12600

Merged
edsiper merged 1 commit into
masterfrom
fix/tests-out-http-json-race
Oct 17, 2026
Merged

edsiper merged 1 commit into
masterfrom
fix/tests-out-http-json-race

Conversation

@edsiper

@edsiper edsiper commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Problem

flb-rt-out_http fails intermittently in the unit test workflow, on master
and on pull requests, always in the same place:

Test format_json_stream...                      [ FAILED ]
  out_http.c:91: Check message == NULL... failed
    formatter output did not contain an expected string

The JSON format cases push their two records with two flb_lib_push() calls.
in_lib appends each read on its own, so when a flush runs between the
pushes the records land in separate chunks. The formatter then runs once per
record, and neither call contains both records, which is what the check
expects. Under parallel ctest load this happens often enough to fail CI.
format_json and format_json_lines have the same race.

Change

Push both records in a single flb_lib_push() in the three JSON format
cases. They are appended to the same chunk and formatted together. The
expected output and the checks are unchanged.

#12582 changes the same test to accept records spread across formatter calls.
This change keeps the check that both records are formatted together, and
also covers format_json and format_json_lines.

Testing

  • flb-rt-out_http: all 15 cases pass (FLB_TEST_HTTP_PORT set locally
    because port 8888 is in use on the test machine).
  • The three JSON cases ran 40 times as 8 parallel processes with no failure.
  • The three JSON cases are clean under Valgrind.

Summary by CodeRabbit

  • Tests
    • Updated JSON, JSON-stream, and JSON-lines formatter tests to verify that multiple records submitted together appear in the expected output.

The JSON format cases pushed their two records separately. When a flush
ran between the pushes, the records went to separate chunks, so each
formatter call held a single record and the check for both records failed.
Push both records at once, so they are appended to the same chunk.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T20:43:53.882823Z da9e04a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ca688446-304e-4131-87d5-1fdc4c64f584
📥 Commits

Reviewing files that changed from the base of the PR and between f5374f7 and da9e04a.

📒 Files selected for processing: 1
  • tests/runtime/out_http.c

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The JSON, JSON-stream, and JSON-lines formatter tests now submit two records through one flb_lib_push call. Their expected outputs still include both records.

Changes: HTTP formatter tests

Layer / File(s) Summary
Submit formatter records in one push
tests/runtime/out_http.c
Each formatter test combines two records into one input buffer and submits them with one flb_lib_push call. Expected output and existing wait and output-count checks remain.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to da9e0

The change batches inputs in three formatter tests while retaining their two-record checks; no merge-blocking risk is apparent.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: updating the out_http runtime tests to push JSON format records together.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@edsiper
edsiper merged commit 0ef6964 into master Oct 17, 2026
60 checks passed
@edsiper
edsiper deleted the fix/tests-out-http-json-race branch October 17, 2026 21:05
@edsiper edsiper added this to the Fluent Bit v5.1.5 milestone Oct 17, 2026

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant