You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "shunping (via GitHub)" <gi...@apache.org> on 2025/09/20 17:33:10 UTC

[I] Python Unit Tests is getting much slower since 2.67.0 [beam]

shunping opened a new issue, #36222:
URL: https://github.com/apache/beam/issues/36222

   ### What happened?
   
   This workflow has been significantly slowing down since 2.67.0
   https://github.com/apache/beam/actions/workflows/python_tests.yml?query=branch%3Amaster+is%3Asuccess
   
   
   17 min -> 34 min (Use Prism as default)
   https://github.com/apache/beam/actions/runs/16780692161
   https://github.com/apache/beam/actions/runs/16781596010
   
   
   34 min - 1h (Make Test Deterministic)
   https://github.com/apache/beam/actions/runs/17051634406/
   
   1h -> 2h (Install Go)
   https://github.com/apache/beam/actions/runs/17881130471/job/50848919392
   
   ### Issue Priority
   
   Priority: 2 (default / most bugs should be filed as P2)
   
   ### Issue Components
   
   - [ ] Component: Python SDK
   - [ ] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [ ] Component: IO connector
   - [ ] Component: Beam YAML
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Infrastructure
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Samza Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


-- 
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: github-unsubscribe@beam.apache.org.apache.org

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


Re: [I] Python Unit Tests is getting much slower since 2.67.0 [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on issue #36222:
URL: https://github.com/apache/beam/issues/36222#issuecomment-3315130813

   cc'ed @damccorm @liferoad @Amar3tto 
   
   I may probably revert the change I made: https://github.com/apache/beam/pull/36221, but we may also need to take a look at the previous changes.
   
   Looks like truly enabling prism as the default direct runner would double our test run time.


-- 
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: github-unsubscribe@beam.apache.org

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


Re: [I] Python Unit Tests is getting much slower since 2.67.0 [beam]

Posted by "Amar3tto (via GitHub)" <gi...@apache.org>.
Amar3tto commented on issue #36222:
URL: https://github.com/apache/beam/issues/36222#issuecomment-3380745429

   > > * [30813 make tests deterministic #35889](https://github.com/apache/beam/pull/35889)
   > 
   > The cleanup fixture (`ensure_clean_state`) from this PR adds at least 100ms to every unit test. You can really feel this when running a test file with 50 or 100 unit tests, where you end up waiting 10s just on cleanup.
   > 
   > As an interim solution, can we somehow only enable this fixture on the GH workflow runs? [@A1K28](https://github.com/A1K28) thoughts?
   
   Let's try


-- 
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: github-unsubscribe@beam.apache.org

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


Re: [I] Python Unit Tests is getting much slower since 2.67.0 [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on issue #36222:
URL: https://github.com/apache/beam/issues/36222#issuecomment-3315188018

   I did a quick runtime comparison between Prism and FnAPI Runner using a very simple workflow.
   
   ```python
   import logging
   
   import apache_beam as beam
   from apache_beam.options.pipeline_options import PipelineOptions
   from apache_beam.transforms import trigger
   from apache_beam.transforms import window
   
   logging.basicConfig(level=logging.INFO)
   
   # fnapi works
   options = PipelineOptions([
       "--streaming",
       "--runner=FnAPIRunner",
   ])
   
   # # prism runner option
   options = PipelineOptions([
       "--streaming",
       "--environment_type=LOOPBACK",
       "--runner=PrismRunner",
       #"--prism_beam_version_override=v2.68.0rc2",
       #"--runner=PortableRunner", "--job_endpoint=localhost:8073",
       #"--experiments=prism_enable_rtc",
       "--prism_log_level=info",
   ])
   
   with beam.Pipeline(options=options) as p:
     result = (
         p | beam.Create([1, 2])
         | beam.WindowInto(
             window.GlobalWindows(),
             trigger=trigger.Repeatedly(trigger.AfterCount(1)),
             accumulation_mode=trigger.AccumulationMode.ACCUMULATING,
             # accumulation_mode=trigger.AccumulationMode.DISCARDING,
             allowed_lateness=0,
         )
         | beam.WithKeys(0)
         | beam.GroupByKey()
         | beam.Values()
         | beam.LogElements(
             level=logging.WARNING,
             with_timestamp=True,
             with_window=True,
             with_pane_info=True,
             use_epoch_time=True))
   ```
   
   - FnAPI Runner: 
     - `0.85s user 0.14s system 98% cpu 0.999 total`
     - `0.86s user 0.14s system 98% cpu 1.013 total`
     - `1.08s user 0.18s system 99% cpu 1.275 total`
   - Prism Runner with cold start. The runtime variates a bit. 
     - `2.35s user 1.44s system 76% cpu 4.974 total`
     - `1.90s user 1.84s system 87% cpu 4.266 total`
     - `3.27s user 2.01s system 87% cpu 6.009 total`
   - Prism Runner with started runner (Portable Runner mode).
     - `1.38s user 0.24s system 96% cpu 1.669 total` 
     - `1.36s user 0.23s system 97% cpu 1.646 total`
     - `1.38s user 0.24s system 97% cpu 1.669 total`
   
   


-- 
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: github-unsubscribe@beam.apache.org

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


Re: [I] Python Unit Tests is getting much slower since 2.67.0 [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on issue #36222:
URL: https://github.com/apache/beam/issues/36222#issuecomment-3315195661

   PR #36221 has been reverted.


-- 
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: github-unsubscribe@beam.apache.org

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


Re: [I] Python Unit Tests is getting much slower since 2.67.0 [beam]

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm closed issue #36222: Python Unit Tests is getting much slower since 2.67.0
URL: https://github.com/apache/beam/issues/36222


-- 
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: github-unsubscribe@beam.apache.org

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


Re: [I] Python Unit Tests is getting much slower since 2.67.0 [beam]

Posted by "hjtran (via GitHub)" <gi...@apache.org>.
hjtran commented on issue #36222:
URL: https://github.com/apache/beam/issues/36222#issuecomment-3367464015

   > * [30813 make tests deterministic #35889](https://github.com/apache/beam/pull/35889)
   
   The cleanup fixture (`ensure_clean_state`) from this PR adds at least 100ms to every unit test. You can really feel this when running a test file with 50 or 100 unit tests, where you end up waiting 10s just on cleanup.
   
   As an interim solution, can we somehow only enable this fixture on the GH workflow runs? @A1K28 thoughts?
   
   


-- 
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: github-unsubscribe@beam.apache.org

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


Re: [I] Python Unit Tests is getting much slower since 2.67.0 [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on issue #36222:
URL: https://github.com/apache/beam/issues/36222#issuecomment-3315234572

   Also cc'ed @A1K28 for https://github.com/apache/beam/pull/35889


-- 
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: github-unsubscribe@beam.apache.org

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