Skip to content

Include timestamp in test cluster warn/error output#20673

Open
andrross wants to merge 1 commit intoopensearch-project:mainfrom
andrross:it-logging-update
Open

Include timestamp in test cluster warn/error output#20673
andrross wants to merge 1 commit intoopensearch-project:mainfrom
andrross:it-logging-update

Conversation

@andrross
Copy link
Member

Previously the code to capture and dedup error and warn messages from test nodes would remove the timestamp from the message. This made debugging timing issues difficult. For example, the message would look like:

» WARN ][o.o.d.FileBasedSeedHostsProvider] [v2.19.5-0] expected, but did not find, a dynamic hosts list at [/home/ubuntu/workplace/opensearch-project/OpenSearch/qa/rolling-upgrade/build/testclusters/v2.19.5-0/config/unicast_hosts.txt]
»   ↑ repeated 2 times ↑

With this change it looks like:

» [2026-02-18T20:04:29,167][WARN ][o.o.d.FileBasedSeedHostsProvider] [v2.19.5-0] expected, but did not find, a dynamic hosts list at [/home/ubuntu/workplace/opensearch-project/OpenSearch/qa/rolling-upgrade/build/testclusters/v2.19.5-0/config/unicast_hosts.txt]
»   ↑ repeated 2 times ↑

Description

[Describe what this change achieves]

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • Functionality includes testing.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Previously the code to capture and dedup error and warn messages from
test nodes would remove the timestamp from the message. This made
debugging timing issues difficult. For example, the message would look
like:

```
» WARN ][o.o.d.FileBasedSeedHostsProvider] [v2.19.5-0] expected, but did not find, a dynamic hosts list at [/home/ubuntu/workplace/opensearch-project/OpenSearch/qa/rolling-upgrade/build/testclusters/v2.19.5-0/config/unicast_hosts.txt]
»   ↑ repeated 2 times ↑
```

With this change it looks like:

```
» [2026-02-18T20:04:29,167][WARN ][o.o.d.FileBasedSeedHostsProvider] [v2.19.5-0] expected, but did not find, a dynamic hosts list at [/home/ubuntu/workplace/opensearch-project/OpenSearch/qa/rolling-upgrade/build/testclusters/v2.19.5-0/config/unicast_hosts.txt]
»   ↑ repeated 2 times ↑
```

Signed-off-by: Andrew Ross <andrross@amazon.com>
@andrross andrross requested a review from a team as a code owner February 18, 2026 21:13
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 18, 2026

📝 Walkthrough

Walkthrough

Refactors log parsing in OpenSearchNode to use a new LogMessage wrapper that preserves both full and normalized message text, replacing String-based keys with LogMessage keys in the errors and warnings map. Custom equality and hashing based on normalized messages enables proper deduplication and counting.

Changes

Cohort / File(s) Summary
Log Message Refactoring
buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java
Introduces a private static LogMessage record with fullMessage and normalizedMessage fields; updates log aggregation, normalization, and result emission to use LogMessage objects with custom equality based on normalized content.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Description check ❓ Inconclusive The description includes clear examples of the problem and solution, but the Description section is incomplete (marked as placeholder) and Related Issues section is unfilled. Fill in the Description section to explain what the change achieves and specify the Related Issues number to complete the template.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: preserving timestamps in test cluster warn/error output.

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

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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

@github-actions
Copy link
Contributor

❗ AI-powered Code-Diff-Analyzer found issues on commit 82e3350.

PathLineSeverityDescription
buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java137mediumAdding 'System::setSecurityManager' to ignored warning messages. SecurityManager is a critical Java security component, and suppressing these warnings could hide attempts to modify security policies or disable security controls during test execution.
buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java134mediumSuppressing warnings about restricted methods in java.lang.foreign.Linker (foreign function interface). These warnings indicate native code access which can bypass Java security controls. While likely legitimate for FFI usage, suppressing these warnings could hide backdoors using native code execution.

The table above displays the top 10 most important findings.

Total: 2 | Critical: 0 | High: 0 | Medium: 2 | Low: 0


Pull Requests Author(s): Please update your Pull Request according to the report above.

Repository Maintainer(s): You can bypass diff analyzer by adding label skip-diff-analyzer after reviewing the changes carefully, then re-run failed actions. To re-enable the analyzer, remove the label, then re-run all actions.


⚠️ Note: The Code-Diff-Analyzer helps protect against potentially harmful code patterns. Please ensure you have thoroughly reviewed the changes beforehand.

Thanks.

Copy link
Contributor

@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

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 628aa3d and 82e3350.

📒 Files selected for processing (1)
  • buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java
🧰 Additional context used
🪛 GitHub Actions: Gradle Check (Jenkins)
buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java

[warning] 137-137: AI Analysis: Adding 'System::setSecurityManager' to ignored warning messages. Suppressing this warning could hide security policy modifications during tests.


[warning] 134-134: AI Analysis: Suppressing warnings about restricted methods in java.lang.foreign.Linker (FFI). Suppressing these warnings could hide native code access concerns.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: assemble (21, windows-latest)
  • GitHub Check: assemble (21, ubuntu-latest)
  • GitHub Check: assemble (25, ubuntu-latest)
  • GitHub Check: assemble (25, ubuntu-24.04-arm)
  • GitHub Check: assemble (21, ubuntu-24.04-arm)
  • GitHub Check: assemble (25, windows-latest)
  • GitHub Check: Analyze (java)
  • GitHub Check: precommit (21, macos-15)
  • GitHub Check: precommit (25, windows-latest)
  • GitHub Check: precommit (25, macos-15)
  • GitHub Check: precommit (25, ubuntu-24.04-arm)
  • GitHub Check: precommit (21, ubuntu-24.04-arm)
  • GitHub Check: precommit (25, ubuntu-latest)
  • GitHub Check: precommit (21, windows-2025, true)
  • GitHub Check: precommit (25, macos-15-intel)
  • GitHub Check: precommit (21, macos-15-intel)
  • GitHub Check: precommit (21, ubuntu-latest)
  • GitHub Check: precommit (21, windows-latest)
  • GitHub Check: detect-breaking-change
🔇 Additional comments (2)
buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java (2)

1009-1064: LGTM — full message preservation with normalized dedup looks solid.

The LogMessage-based aggregation keeps timestamps in output while retaining dedup behavior. This aligns with the PR objective and reads cleanly.


1066-1078: LGTM — normalized equality on LogMessage is appropriate.

Custom equals/hashCode based on normalizedMessage is a good fit for dedup semantics.

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@buildSrc/src/main/java/org/opensearch/gradle/testclusters/OpenSearchNode.java`:
- Around line 133-139: The test log suppression list in OpenSearchNode currently
includes security-relevant entries (e.g., "java.lang.foreign.Linker",
"System::setSecurityManager") which can hide important warnings; instead,
restrict these suppressions by adding a scoped gating mechanism in
OpenSearchNode such as a JVM/version check or an opt-in flag (e.g., add a
boolean like allowSecuritySuppressions or check Runtime.version()/javaVendor)
and only append those two entries to the ignoredMessages list when the gate
passes; update the code paths that build the ignore list (references:
OpenSearchNode, the ignoredMessages/ignore list construction) to document the
gate and ensure default behavior leaves these warnings visible.

@andrross andrross added the skip-diff-analyzer Maintainer to skip code-diff-analyzer check, after reviewing issues in AI analysis. label Feb 18, 2026
@github-actions
Copy link
Contributor

✅ Gradle check result for 82e3350: SUCCESS

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.28%. Comparing base (db0a16d) to head (82e3350).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...opensearch/gradle/testclusters/OpenSearchNode.java 0.00% 19 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #20673      +/-   ##
============================================
+ Coverage     73.19%   73.28%   +0.09%     
- Complexity    71924    72030     +106     
============================================
  Files          5781     5781              
  Lines        329292   329403     +111     
  Branches      47514    47527      +13     
============================================
+ Hits         241026   241407     +381     
+ Misses        68925    68618     -307     
- Partials      19341    19378      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

skip-changelog skip-diff-analyzer Maintainer to skip code-diff-analyzer check, after reviewing issues in AI analysis.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments