File tree Expand file tree Collapse file tree 1 file changed +0
-25
lines changed
core/src/test/java/io/grpc/internal Expand file tree Collapse file tree 1 file changed +0
-25
lines changed Original file line number Diff line number Diff 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 =
You can’t perform that action at this time.
0 commit comments