Skip to content

Commit

Permalink
Fix flaky ResourceAwareTasksTests.testBasicTaskResourceTracking test (#…
Browse files Browse the repository at this point in the history
…8993)

Signed-off-by: Ketan Verma <ketan9495@gmail.com>
  • Loading branch information
ketanv3 committed Aug 1, 2023
1 parent 639d28a commit b2a7348
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 @@ -111,6 +111,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 b2a7348

Please sign in to comment.