You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "injae-kim (via GitHub)" <gi...@apache.org> on 2024/03/30 09:46:10 UTC

[PR] Fix mustBeAbleToUseMapWithAutoCloseableResource broken test [pekko]

injae-kim opened a new pull request, #1241:
URL: https://github.com/apache/pekko/pull/1241

   Closes #1229.
   
   ```
     @Test
     public void mustBeAbleToUseMapWithAutoCloseableResource() {
       final TestKit probe = new TestKit(system);
       final AtomicInteger closed = new AtomicInteger();
       Source.from(Arrays.asList("1", "2", "3"))
           .via(
               Flow.of(String.class)
                   .mapWithResource(
                       () -> (AutoCloseable) closed::incrementAndGet, (resource, elem) -> elem))
           .runWith(Sink.foreach(elem -> probe.getRef().tell(elem, ActorRef.noSender())), system);
   
       probe.expectMsgAllOf("1", "2", "3");
       Assert.assertEquals(closed.get(), 1); // 👈👈 clean-up may not be processed yet here!
     }
   ```
   I found that `AutoCloseable resource.close();` can be not invoked yet on above code so fix it~!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org


Re: [PR] Fix mustBeAbleToUseMapWithAutoCloseableResource broken test [pekko]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #1241:
URL: https://github.com/apache/pekko/pull/1241


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org