Skip to content

NIFI-15327 Enabled TestSiteToSiteMetricsReportingTask on Windows.#10627

Closed
dan-s1 wants to merge 1 commit intoapache:mainfrom
dan-s1:NIFI-15327
Closed

NIFI-15327 Enabled TestSiteToSiteMetricsReportingTask on Windows.#10627
dan-s1 wants to merge 1 commit intoapache:mainfrom
dan-s1:NIFI-15327

Conversation

@dan-s1
Copy link
Contributor

@dan-s1 dan-s1 commented Dec 10, 2025

Summary

NIFI-15327
The reason there was a test failure on Windows was due to line 144 in MetricsService
where method fileDescriptorUsage() of JvmMetrics returned NaN.

Apparently it returned NaN because "File descriptor usage" is a metric specific to Unix-like operating systems. When trying to translate NaN to JSON, org.eclipse.parsson.JsonNumberImpl.getJsonNumber threw an exception since according to the official JSON specification, NaN is not valid numeric values within a strict JSON document.
Hence the solution for this was to test for NaN and if present replace the value with -1 (a valid numeric value and a number which indicates more than 0 that there is no possibility of any File descriptors).
In addition to removing the disabled on Windows annotation in TestSiteToSiteMetricsReportingTask, I also followed the Intellij suggestions in order to clean up the code.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • Pull Request refers to a feature branch with one commit containing changes

Verification

Please indicate the verification steps performed prior to pull request creation.

Build

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

mark-bathori pushed a commit to mark-bathori/nifi that referenced this pull request Feb 5, 2026
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes apache#10627.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants