Skip to content

Commit

Permalink
Fix flaky ResourceAwareTasksTests.testBasicTaskResourceTracking test
Browse files Browse the repository at this point in the history
Signed-off-by: Ketan Verma <ketan9495@gmail.com>
  • Loading branch information
ketanv3 committed Jul 31, 2023
1 parent a3aab67 commit 26a05c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Removed

### Fixed
- Fix flaky ResourceAwareTasksTests.testBasicTaskResourceTracking test ([#8993](https://github.com/opensearch-project/OpenSearch/pull/8993))

### Security

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,8 @@ private void assertTasksRequestFinishedSuccessfully(NodesResponse nodesResponse,
}

private void assertMemoryUsageWithinLimits(long actual, long expected) {
// 5% buffer up to 200 KB to account for classloading overhead.
long maxOverhead = Math.min(200000, expected * 5 / 100);
// 5% buffer up to 500 KB to account for classloading overhead.
long maxOverhead = Math.min(500000, expected * 5 / 100);
assertThat(actual, lessThanOrEqualTo(expected + maxOverhead));
}

Expand Down

0 comments on commit 26a05c3

Please sign in to comment.