beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (BEAM-3409) Unexpected behavior of DoFn teardown method running in unit tests
Date Tue, 09 Jan 2018 10:32:00 GMT


ASF GitHub Bot commented on BEAM-3409:

rmannibucau opened a new pull request #4372: BEAM-3409 starting to fix the wait of direct
   Using the direct runner, doesn't wait for the teardown execution
   This PR contains these fixes:
   1. for each dofn registered it will create a latch the execution will wait on for waitUntilFinish
and guarantee
   the teardown methods are included into this "wait"
   2. For SDF it ensure the dofnmanager are released and therefore than teardown is called
(propagating previous logic as well)

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> Unexpected behavior of DoFn teardown method running in unit tests 
> ------------------------------------------------------------------
>                 Key: BEAM-3409
>                 URL:
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-direct, testing
>    Affects Versions: 2.3.0
>            Reporter: Alexey Romanenko
>            Assignee: Jean-Baptiste Onofré
>            Priority: Minor
>              Labels: test
> Writing a unit test, I found out a strange behaviour of Teardown method of DoFn implementation
when I run this method in unit tests using TestPipeline.
> To be more precise, it doesn’t wait until teardown() method will be finished, it just
exits from this method after about 1 sec (on my machine) even if it should take longer (very
simple example - running infinite loop inside this method or put thread in sleep). In the
same time, when I run the same code from main() with ordinary Pipeline and direct runner,
then it’s ok and it works as expected - teardown() method will be performed completely despite
how much time it will take.
> I created two test cases to reproduce this issue - the first one to run with main() and
the second one to run with junit. They use the same implementation of DoFn (class LongTearDownFn)
and expects that teardown method will be running at least for SLEEP_TIME ms. In case of running
as junit test it's not a case (see output log).
> - run with main()
> - run with junit

This message was sent by Atlassian JIRA

View raw message