Skip to content

Commit 0e2fa3e

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
RELNOTES=n/a PiperOrigin-RevId: 686728364
1 parent 8f747d0 commit 0e2fa3e

27 files changed

+46
-4
lines changed

android/guava-testlib/test/com/google/common/testing/GcFinalizationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ class Interruptenator extends Thread {
120120
this(interruptee, new AtomicBoolean(false));
121121
}
122122

123+
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
123124
Interruptenator(final Thread interruptee, final AtomicBoolean shutdown) {
124125
super(
125126
new Runnable() {
@@ -135,6 +136,7 @@ public void run() {
135136
start();
136137
}
137138

139+
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
138140
void shutdown() {
139141
shutdown.set(true);
140142
while (this.isAlive()) {

android/guava-tests/test/com/google/common/cache/CacheBuilderTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ public void run() {
466466
*/
467467
@GwtIncompatible // QueuingRemovalListener
468468

469+
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
469470
public void testRemovalNotification_clear_basher() throws InterruptedException {
470471
// If a clear() happens close to the end of computation, one of two things should happen:
471472
// - computation ends first: the removal listener is called, and the cache does not contain the

android/guava-tests/test/com/google/common/cache/CacheLoadingTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,6 +2010,7 @@ public String load(String key) throws IOException, InterruptedException {
20102010
* {@code getUnchecked}, and threads with an odd index will call {@code get}. If the cache throws
20112011
* exceptions, this difference may be visible in the returned List.
20122012
*/
2013+
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
20132014
private static <K> List<Object> doConcurrentGet(
20142015
final LoadingCache<K, ?> cache,
20152016
final K key,
@@ -2248,6 +2249,7 @@ public void run() {
22482249
assertEquals(refreshKey + suffix, map.get(refreshKey));
22492250
}
22502251

2252+
@SuppressWarnings("ThreadPriorityCheck") // doing our best to test for races
22512253
public void testExpandDuringLoading() throws InterruptedException {
22522254
final int count = 3;
22532255
final AtomicInteger callCount = new AtomicInteger();
@@ -2337,6 +2339,7 @@ public void run() {
23372339
}
23382340

23392341
// Test ignored because it is extremely flaky in CI builds
2342+
@SuppressWarnings("ThreadPriorityCheck") // doing our best to test for races
23402343
public void
23412344
ignoreTestExpandDuringRefresh()
23422345
throws InterruptedException, ExecutionException {

android/guava-tests/test/com/google/common/cache/LocalCacheTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ public String load(String key) {
558558
}
559559

560560
@Override
561+
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
561562
public ListenableFuture<String> reload(String key, String oldValue) {
562563
return refreshExecutor.submit(
563564
() -> {

android/guava-tests/test/com/google/common/collect/QueuesTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ private void assertInterruptibleDrained(BlockingQueue<Object> q) {
279279
}
280280

281281
// same as above; uninterruptible version
282+
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
282283
private void assertUninterruptibleDrained(BlockingQueue<Object> q) {
283284
assertEquals(0, Queues.drainUninterruptibly(q, ImmutableList.of(), 0, 10, MILLISECONDS));
284285

android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureBenchmarks.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ <T> Facade<T> newFacade() {
8585
abstract <T> Facade<T> newFacade();
8686
}
8787

88+
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
8889
static void awaitWaiting(Thread t) {
8990
while (true) {
9091
Thread.State state = t.getState();

android/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,7 @@ public void run() {
12381238
}
12391239
}
12401240

1241+
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
12411242
void awaitWaiting() {
12421243
while (!isBlocked()) {
12431244
if (getState() == State.TERMINATED) {
@@ -1279,6 +1280,7 @@ public void run() {
12791280
}
12801281
}
12811282

1283+
@SuppressWarnings("ThreadPriorityCheck") // TODO: b/175898629 - Consider onSpinWait.
12821284
void awaitWaiting() {
12831285
while (!isBlocked()) {
12841286
if (getState() == State.TERMINATED) {

android/guava-tests/test/com/google/common/util/concurrent/AbstractScheduledServiceTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ protected void runOneIteration() {}
531531
protected Scheduler scheduler() {
532532
return new CustomScheduler() {
533533
@Override
534+
@SuppressWarnings("ThreadPriorityCheck") // doing our best to test for races
534535
protected Schedule getNextSchedule() throws Exception {
535536
if (state() != State.STARTING) {
536537
inGetNextSchedule.await();
@@ -555,6 +556,7 @@ public void testBig() throws Exception {
555556
protected Scheduler scheduler() {
556557
return new AbstractScheduledService.CustomScheduler() {
557558
@Override
559+
@SuppressWarnings("ThreadPriorityCheck") // doing our best to test for races
558560
protected Schedule getNextSchedule() throws Exception {
559561
// Explicitly yield to increase the probability of a pathological scheduling.
560562
Thread.yield();

android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleArrayTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public void testCompareAndSetInMultipleThreads() throws InterruptedException {
161161
newStartedThread(
162162
new CheckedRunnable() {
163163
@Override
164+
@SuppressWarnings("ThreadPriorityCheck") // doing our best to test for races
164165
public void realRun() {
165166
while (!a.compareAndSet(0, 2.0, 3.0)) {
166167
Thread.yield();

android/guava-tests/test/com/google/common/util/concurrent/AtomicDoubleTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public void testCompareAndSetInMultipleThreads() throws Exception {
104104
newStartedThread(
105105
new CheckedRunnable() {
106106
@Override
107+
@SuppressWarnings("ThreadPriorityCheck") // doing our best to test for races
107108
public void realRun() {
108109
while (!at.compareAndSet(2.0, 3.0)) {
109110
Thread.yield();

0 commit comments

Comments
 (0)