Skip to content

Commit

Permalink
8318809: java/util/concurrent/ConcurrentLinkedQueue/WhiteBox.java sho…
Browse files Browse the repository at this point in the history
…ws intermittent failures on linux ppc64le and aarch64

Backport-of: 50d1839
  • Loading branch information
Amos Shi committed Apr 28, 2024
1 parent f7d0522 commit 81f2413
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 81f2413

Please sign in to comment.