Skip to content

Commit

Permalink
Backport 50d1839d54f13631946925d8ecf03ce71f31bab8
Browse files Browse the repository at this point in the history
  • Loading branch information
amosshi committed Apr 26, 2024
1 parent b13cb2f commit 7861b34
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions test/jdk/java/util/concurrent/ConcurrentLinkedQueue/WhiteBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,36 +281,6 @@ public void pollActionsOneNodeSlack(
assertInvariants(q);
}

/**
* Actions that append an element, and are expected to
* leave at most one slack node at tail.
*/
@DataProvider
public Object[][] addActions() {
return List.<Consumer<ConcurrentLinkedQueue>>of(
q -> q.add(1),
q -> q.offer(1))
.stream().map(x -> new Object[]{ x }).toArray(Object[][]::new);
}

@Test(dataProvider = "addActions")
public void addActionsOneNodeSlack(
Consumer<ConcurrentLinkedQueue> addAction) {
ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
int n = 1 + rnd.nextInt(5);
for (int i = 0; i < n; i++) {
boolean slack = next(tail(q)) != null;
addAction.accept(q);
if (slack)
assertNull(next(tail(q)));
else {
assertNotNull(next(tail(q)));
assertNull(next(next(tail(q))));
}
assertInvariants(q);
}
}

byte[] serialBytes(Object o) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Expand Down

0 comments on commit 7861b34

Please # to comment.