Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static SetPriorityAction parse(XContentParser parser) {
}

public SetPriorityAction(@Nullable Integer recoveryPriority) {
if (recoveryPriority != null && recoveryPriority <= 0) {
if (recoveryPriority != null && recoveryPriority < 0) {
throw new IllegalArgumentException("[" + RECOVERY_PRIORITY_FIELD.getPreferredName() + "] must be 0 or greater");
}
this.recoveryPriority = recoveryPriority;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected boolean supportsUnknownFields() {
}

public void testNonPositivePriority() {
Exception e = expectThrows(Exception.class, () -> new SetPriorityAction(randomIntBetween(-100, 0)));
Exception e = expectThrows(Exception.class, () -> new SetPriorityAction(randomIntBetween(-100, -1)));
assertThat(e.getMessage(), equalTo("[priority] must be 0 or greater"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ protected Reader<SetPriorityAction> instanceReader() {
return SetPriorityAction::new;
}

@AwaitsFix(bugUrl="https://github.com/elastic/elasticsearch/issues/37652")
public void testNonPositivePriority() {
Exception e = expectThrows(Exception.class, () -> new SetPriorityAction(randomIntBetween(-100, 0)));
Exception e = expectThrows(Exception.class, () -> new SetPriorityAction(randomIntBetween(-100, -1)));
assertThat(e.getMessage(), equalTo("[priority] must be 0 or greater"));
}

Expand Down