You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beam.apache.org by Quentin Sommer <qu...@transit.app> on 2021/08/30 10:51:02 UTC

Freeze time to test a python pipeline with TestPipeline and DirectRunner

Hi,

I'm working on a python streaming pipeline and I'm trying to simulate
different execution times to test business logic depending on current time
+ records data. When I freeze the time using freezegun
<https://github.com/spulec/freezegun> the TestPipeline never finishes. I'm
guessing it is waiting for some time to pass but as the time is frozen it
never changes.
Do you know any workaround or a different approach to test this?

Best

Re: Freeze time to test a python pipeline with TestPipeline and DirectRunner

Posted by Quentin Sommer <qu...@transit.app>.
Got it, thanks!

On Mon, Aug 30, 2021 at 7:09 PM Luke Cwik <lc...@google.com> wrote:

> Most folks test using TestStream since they can inject data and control
> quiescence within the pipeline.
>
> On Mon, Aug 30, 2021 at 3:51 AM Quentin Sommer <qu...@transit.app>
> wrote:
>
>> Hi,
>>
>> I'm working on a python streaming pipeline and I'm trying to simulate
>> different execution times to test business logic depending on current time
>> + records data. When I freeze the time using freezegun
>> <https://github.com/spulec/freezegun> the TestPipeline never finishes.
>> I'm guessing it is waiting for some time to pass but as the time is frozen
>> it never changes.
>> Do you know any workaround or a different approach to test this?
>>
>> Best
>>
>

Re: Freeze time to test a python pipeline with TestPipeline and DirectRunner

Posted by Luke Cwik <lc...@google.com>.
Most folks test using TestStream since they can inject data and control
quiescence within the pipeline.

On Mon, Aug 30, 2021 at 3:51 AM Quentin Sommer <qu...@transit.app> wrote:

> Hi,
>
> I'm working on a python streaming pipeline and I'm trying to simulate
> different execution times to test business logic depending on current time
> + records data. When I freeze the time using freezegun
> <https://github.com/spulec/freezegun> the TestPipeline never finishes.
> I'm guessing it is waiting for some time to pass but as the time is frozen
> it never changes.
> Do you know any workaround or a different approach to test this?
>
> Best
>