Skip to content

Commit

Permalink
fixup merge issues of #2362
Browse files Browse the repository at this point in the history
 - Missing Assertions import
 - Mistakenly replaced a usage of `b` with a usage of `buffer`

See: 480f976
See: #2362
  • Loading branch information
simonbasle committed Sep 10, 2020
1 parent 480f976 commit e12cfcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void cancel() {
synchronized (this) {
b = buffer;
buffer = null;
Operators.onDiscardMultiple(buffer, actual.currentContext());
Operators.onDiscardMultiple(b, actual.currentContext());
}
cleanup();
Operators.terminate(S, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.function.Supplier;
import java.util.stream.Collectors;

import org.assertj.core.api.Assertions;
import org.junit.Assert;
import org.junit.Test;
import org.reactivestreams.Subscriber;
Expand Down Expand Up @@ -1091,9 +1092,9 @@ public void discardRaceWithOnNext_bufferAdds() {
}

Assertions.assertThat(received.get() + (value1.get() + 1) + (value2.get() + 2))
.as("received " + received.get() + ", val1 state " + value1.get() + ", val2 state " + value2.get())
.withFailMessage("\nExpecting values to be either received or discarded in round %s/%s (%s)", i, ROUNDS, i % 2 == 0 ? "cancel/onNext" : "onNext/cancel")
.isEqualTo(2);
.as("received " + received.get() + ", val1 state " + value1.get() + ", val2 state " + value2.get())
.withFailMessage("\nExpecting values to be either received or discarded in round %s/%s (%s)", i, ROUNDS, i % 2 == 0 ? "cancel/onNext" : "onNext/cancel")
.isEqualTo(2);
}
}

Expand Down

0 comments on commit e12cfcc

Please sign in to comment.