Skip to content

Commit e5d24f5

Browse files
committed
Remove extraneous changes beyond avoiding the false positive warnings, since super.shutdown() is never expected to throw.
Also remove redundant unit test. Rework of PR grpc#12705.
1 parent 37eb736 commit e5d24f5

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

core/src/test/java/io/grpc/internal/ManagedChannelOrphanWrapperTest.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -140,31 +140,6 @@ public boolean isLoggable(LogRecord record) {
140140
}
141141
}
142142

143-
@Test
144-
public void orphanedChannel_triggerWarningAndCoverage() {
145-
ManagedChannel mc = new TestManagedChannel();
146-
final ReferenceQueue<ManagedChannelOrphanWrapper> refqueue = new ReferenceQueue<>();
147-
ConcurrentMap<ManagedChannelReference, ManagedChannelReference> refs =
148-
new ConcurrentHashMap<>();
149-
150-
// Create the wrapper but NEVER call shutdown
151-
@SuppressWarnings("UnusedVariable")
152-
ManagedChannelOrphanWrapper wrapper = new ManagedChannelOrphanWrapper(mc, refqueue, refs);
153-
wrapper = null; // Make it eligible for GC
154-
155-
// Trigger GC and clean the queue to hit the !wasShutdown branch
156-
final AtomicInteger numOrphans = new AtomicInteger();
157-
GcFinalization.awaitDone(new FinalizationPredicate() {
158-
@Override
159-
public boolean isDone() {
160-
numOrphans.getAndAdd(ManagedChannelReference.cleanQueue(refqueue));
161-
return numOrphans.get() > 0;
162-
}
163-
});
164-
165-
assertEquals(1, numOrphans.get());
166-
}
167-
168143
@Test
169144
public void refCycleIsGCed() {
170145
ReferenceQueue<ManagedChannelOrphanWrapper> refqueue =

0 commit comments

Comments
 (0)