[BUG] Incorrect cast to int in RemoteSegmentTransferTrackerTests.testStatsObjectCreationViaStream()
test
#14694
Labels
RemoteSegmentTransferTrackerTests.testStatsObjectCreationViaStream()
test
#14694
Describe the bug
I am running into the following issue:
The following line is causing the issue:
OpenSearch/server/src/test/java/org/opensearch/index/remote/RemoteSegmentTransferTrackerTests.java
Line 580 in 13f04d9
When I add the following assert before the line 580
Then the assert fails
What is the point of casting
double
toint
when the original value can be larger thanInteger.MAX_VALUE
(for example5037810928
in my case)?In fact all the following three lines are IMO incorrectly using cast to
int
:OpenSearch/server/src/test/java/org/opensearch/index/remote/RemoteSegmentTransferTrackerTests.java
Lines 574 to 580 in 13f04d9
BTW, compare it to similar three lines from different test from the same class
OpenSearch/server/src/test/java/org/opensearch/index/remote/RemoteSegmentTransferTrackerTests.java
Lines 545 to 547 in 13f04d9
I believe this issues is perhaps quick cut&paste issue or something along the lines.
This issue has been already partially reported in #10014
Feel free to assign this ticket to me, I will send PR.PR sent.Related component
Storage:Remote
To Reproduce
Please see the description above.
Expected behavior
The test should pass.
Additional Details
Host/Environment (please complete the following information):
% uname -a Darwin Lukass-MBP.xxxx.xxxx 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:52:24 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6000 arm64
main
branchThe text was updated successfully, but these errors were encountered: