Skip to content

tests: fixed Windows support for cumulative_to_delta test case#11589

Merged
edsiper merged 1 commit intofluent:masterfrom
mabrarov:feature/processor_cumulative_to_delta_windows
Mar 21, 2026
Merged

tests: fixed Windows support for cumulative_to_delta test case#11589
edsiper merged 1 commit intofluent:masterfrom
mabrarov:feature/processor_cumulative_to_delta_windows

Conversation

@mabrarov
Copy link
Copy Markdown
Contributor

@mabrarov mabrarov commented Mar 19, 2026

This PR fixes part of issue with building of internal tests on Windows - refer to #11472 (comment). The 2nd part of the fix is located in fluent/cmetrics#258 which after merging needs to be copied (as part of CMetrics library) into this repository.


Testing

Before we can approve your change; please submit the following in a comment:

  • [N/A] Example configuration file for the change.
  • [N/A] Debug log output from testing the change.
  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found.
  • [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.

Related PRs in other repositories

  1. cmetrics: improved Windows support cmetrics#258 for similar changes in CMetrics library.

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

  • Bug Fixes
    • Improved Windows header handling to avoid conflicts and ensure cleaner builds on Windows.
  • Tests
    • Replaced a direct POSIX include in a test with the project's compatibility header to standardize test environment.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

Adds conditional handling for WIN32_LEAN_AND_MEAN around Windows header inclusions in two cmetrics files and replaces an #include <unistd.h> with #include <fluent-bit/flb_compat.h> in one test file.

Changes

Cohort / File(s) Summary
Windows Header Compatibility
lib/cmetrics/include/cmetrics/cmt_compat.h, lib/cmetrics/src/cmt_atomic_msvc.c
Conditionally define WIN32_LEAN_AND_MEAN if not already defined, include <windows.h>, then undefine it to preserve existing build configurations. No other logic changes.
Test Include Adjustment
tests/internal/cumulative_to_delta.c
Replaced #include <unistd.h> with #include <fluent-bit/flb_compat.h>; ensure POSIX symbols (e.g., sleep()) remain available via the compatibility header.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • edsiper
  • cosmo0920

Poem

🐰 Hopped through headers, soft and spry,
I tucked a macro, gave it a try.
Included, then cleared—nice and neat,
Swapped an include for fewer feet.
A tiny hop for cleaner builds—so spry!

🚥 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
Title check ✅ Passed The title accurately describes the main change: fixing Windows support for the cumulative_to_delta test case, which is the primary objective of this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Tip

You can enable review details to help with troubleshooting, context usage and more.

Enable the reviews.review_details setting to include review details such as the model used, the time taken for each step and more in the review comments.

Copy link
Copy Markdown

@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: 66c5528e8b

ℹ️ 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".

Signed-off-by: Marat Abrarov <abrarov@gmail.com>
@cosmo0920 cosmo0920 added this to the Fluent Bit v5.0 milestone Mar 20, 2026
Copy link
Copy Markdown
Contributor

@cosmo0920 cosmo0920 left a comment

Choose a reason for hiding this comment

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

Could you remove cmetrics changes from this PR, please?

@mabrarov
Copy link
Copy Markdown
Contributor Author

Hi @cosmo0920,

Could you remove cmetrics changes from this PR, please?

This PR is not going to build on Windows without CMetrics changes. Is it acceptable?

Thank you.

@cosmo0920 cosmo0920 changed the title tests: fixed Windows support tests: fixed Windows support for cumulative_to_delta test case Mar 21, 2026
@cosmo0920
Copy link
Copy Markdown
Contributor

cosmo0920 commented Mar 21, 2026

Hi @cosmo0920,

Could you remove cmetrics changes from this PR, please?

This PR is not going to build on Windows without CMetrics changes. Is it acceptable?

Thank you.

It depends on @edsiper's decision but we must need to merge the cmetrics' changes at first on paper.
Then, returning back to change Fluent Bit itself.
During waiting for cmetrics's changes, it's OK to break CI results.
After merging cmetrics' patch, we must need to rebase off master and confirm the CI results.

@cosmo0920
Copy link
Copy Markdown
Contributor

I confirmed that your patch with cmetrics's changes fixes the Windows issue on test case for cumulative_to_delta.

@mabrarov mabrarov force-pushed the feature/processor_cumulative_to_delta_windows branch from da4b352 to 52d97c9 Compare March 21, 2026 01:22
@mabrarov
Copy link
Copy Markdown
Contributor Author

da4b352 commit with CMetrics changes (which is copied in fluent/cmetrics#258) was removed from this PR.

@edsiper edsiper merged commit 59ccf3e into fluent:master Mar 21, 2026
2 checks passed
@mabrarov mabrarov deleted the feature/processor_cumulative_to_delta_windows branch March 21, 2026 12:47
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.

3 participants