Fix long/int precision for test baseport calculation

This commit is contained in:
Ryan Ernst 2020-06-23 16:02:13 -07:00
parent 6285b87b97
commit 88f1dab8b5
No known key found for this signature in database
GPG Key ID: 5F7EA39E15F54DCE
1 changed files with 1 additions and 1 deletions

View File

@ -1439,7 +1439,7 @@ public abstract class ESTestCase extends LuceneTestCase {
// increases this value, so the mod can eventually become zero, thus we shift on both sides by 1 // increases this value, so the mod can eventually become zero, thus we shift on both sides by 1
final long workerId = Long.valueOf(workerIdStr); final long workerId = Long.valueOf(workerIdStr);
assert workerId >= 1 : "Non positive gradle worker id: " + workerIdStr; assert workerId >= 1 : "Non positive gradle worker id: " + workerIdStr;
startAt = Math.floorMod(workerId - 1, 223) + 1; startAt = (int) Math.floorMod(workerId - 1, 223L) + 1;
} }
assert startAt >= 0 : "Unexpected test worker Id, resulting port range would be negative"; assert startAt >= 0 : "Unexpected test worker Id, resulting port range would be negative";
return 10300 + (startAt * 100); return 10300 + (startAt * 100);