Skip to content

Fix DiskUsageTests NodeStats constructor call - #21770

Merged
reta merged 1 commit into
opensearch-project:mainfrom
cwperks:fix-code-ql
May 21, 2026
Merged

Fix DiskUsageTests NodeStats constructor call#21770
reta merged 1 commit into
opensearch-project:mainfrom
cwperks:fix-code-ql

Conversation

@cwperks

@cwperks cwperks commented May 20, 2026

Copy link
Copy Markdown
Member

Description

Fixes a compile failure in DiskUsageTests caused by the test helper using an outdated NodeStats constructor argument list.

Breaking change was #21637

Break can be seen in https://github.com/opensearch-project/OpenSearch/actions/runs/26195056157/job/77072446112

NodeStats now accepts AnalyticsBackendNativeMemoryStats as the final constructor argument. The makeNodeStatsWithResourceUsage helper in DiskUsageTests was missing that trailing argument, which caused CodeQL autobuild to fail during test compilation.

This change adds the missing null argument so the helper matches the current constructor signature.

Related Issues

Fixes

  [2026-05-20 23:15:14] [autobuild] > Task :server:compileTestJava
  [2026-05-20 23:15:14] [autobuild] /home/runner/work/OpenSearch/OpenSearch/server/src/test/java/org/opensearch/cluster/DiskUsageTests.java:473: error: no suitable constructor found for NodeStats(DiscoveryNode,int,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,NodesResourceUsageStats,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>,<null>)
  [2026-05-20 23:15:14] [autobuild]         return new NodeStats(
  [2026-05-20 23:15:14] [autobuild]                ^
  [2026-05-20 23:15:14] [autobuild]     constructor NodeStats.NodeStats(StreamInput) is not applicable
  [2026-05-20 23:15:14] [autobuild]       (actual and formal argument lists differ in length)
  [2026-05-20 23:15:14] [autobuild]     constructor NodeStats.NodeStats(DiscoveryNode,long,NodeIndicesStats,OsStats,ProcessStats,JvmStats,ThreadPoolStats,FsInfo,TransportStats,HttpStats,AllCircuitBreakerStats,ScriptStats,DiscoveryStats,IngestStats,AdaptiveSelectionStats,NodesResourceUsageStats,ScriptCacheStats,IndexingPressureStats,ShardIndexingPressureStats,SearchBackpressureStats,ClusterManagerThrottlingStats,WeightedRoutingStats,AggregateFileCacheStats,TaskCancellationStats,SearchPipelineStats,SegmentReplicationRejectionStats,RepositoriesStats,AdmissionControlStats,NodeCacheStats,RemoteStoreNodeStats,AnalyticsBackendNativeMemoryStats) is not applicable
  [2026-05-20 23:15:14] [autobuild]       (actual and formal argument lists differ in length

Check List

  • New functionality includes testing.
  • All tests pass.
  • New functionality has been documented.

Testing

  • ./gradlew :server:compileTestJava
  • ./gradlew :server:test --tests org.opensearch.cluster.DiskUsageTests
  • ./gradlew :server:spotlessJavaCheck

Signed-off-by: Craig Perkins <craig5008@gmail.com>
@cwperks
cwperks marked this pull request as ready for review May 20, 2026 23:59
@cwperks
cwperks requested a review from a team as a code owner May 20, 2026 23:59
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@cwperks cwperks mentioned this pull request May 21, 2026
3 tasks

@reta reta left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @cwperks !

@github-actions

Copy link
Copy Markdown
Contributor

✅ Gradle check result for 0f4a8a7: SUCCESS

@codecov

codecov Bot commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.40%. Comparing base (a6b5e43) to head (0f4a8a7).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #21770      +/-   ##
============================================
- Coverage     73.43%   73.40%   -0.04%     
+ Complexity    75103    75053      -50     
============================================
  Files          6016     6016              
  Lines        341072   341072              
  Branches      49091    49091              
============================================
- Hits         250469   250348     -121     
- Misses        70682    70785     +103     
- Partials      19921    19939      +18     

☔ 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.

@reta
reta merged commit f4f1029 into opensearch-project:main May 21, 2026
19 of 20 checks passed
KhishorekumarBS pushed a commit to KhishorekumarBS/OpenSearch that referenced this pull request Jul 3, 2026
Signed-off-by: Craig Perkins <craig5008@gmail.com>
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