Skip to content

Conversation

@mabrarov
Copy link
Contributor

@mabrarov mabrarov commented Jan 22, 2026

Support of Windows in flb-it-input_chunk_routes tests (introduced in #11097).


Testing

  • [N/A] Example configuration file for the change.
  • [N/A] Debug log output from testing the change.
  • Attached Valgrind output that shows no leaks or memory corruption was found - refer to flb_run_code_analysis.log for the output of command
    TEST_PRESET=valgrind SKIP_TESTS='flb-rt-out_td flb-it-network' ./run_code_analysis.sh
  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature.

Backporting

  • [N/A] Backport to latest stable release.

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

  • Tests
    • Improved test infrastructure to use per-test temporary directories, enabling isolated test data paths.
    • More robust setup and teardown with consistent cleanup on error paths to prevent resource leaks.
    • Enhanced memory management during tests while preserving existing test behavior and outcomes.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Replaces hard-coded test stream paths in tests/internal/input_chunk_routes.c with environment-aware, dynamically allocated paths and adds robust allocation/error cleanup and corresponding includes; no public APIs changed. (48 words)

Changes

Cohort / File(s) Summary
Test infrastructure — dynamic temp paths
tests/internal/input_chunk_routes.c
Add env_tmpdir/tmpdir_cat helpers usage; replace TEST_STREAM_PATH constants with stream_path allocations; propagate stream_path through setup/teardown and cleanup calls; free stream_path on all error and exit paths; add <flb_str.h> and <stdlib.h> includes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • edsiper

Poem

🐰 I hopped and found a tempdir bright,

No more constants in the night,
I build the path, then free with care,
Tests prance lightly, tidy and fair.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding Windows support to the input_chunk_routes test by implementing dynamic path handling instead of hard-coded paths.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cfa533bbda

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@tests/internal/input_chunk_routes.c`:
- Around line 338-356: The env_tmpdir function currently checks TMPDIR then TMP
and falls back to "/tmp", which fails on Windows when TEMP is set but TMP is
not; update env_tmpdir to also check getenv("TEMP") before the fallback and on
Windows use a Windows-appropriate fallback (either call
GetTempPathA()/GetTempPathW when available or use "C:\\Temp") instead of "/tmp",
returning the result via flb_strdup to match existing allocation behavior.
🧹 Nitpick comments (1)
tests/internal/input_chunk_routes.c (1)

20-21: Remove duplicate flb_mem.h include.

<fluent-bit/flb_mem.h> is already included at Line 10, so the Line 20 include is redundant.

♻️ Suggested cleanup
-#include <fluent-bit/flb_mem.h>
 `#include` <fluent-bit/flb_str.h>

Signed-off-by: Marat Abrarov <abrarov@gmail.com>
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