[
https://issues.apache.org/jira/browse/BEAM-11476?focusedWorklogId=551960&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-551960
]
ASF GitHub Bot logged work on BEAM-11476:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Feb/21 19:52
Start Date: 12/Feb/21 19:52
Worklog Time Spent: 10m
Work Description: KevinGG opened a new pull request #13984:
URL: https://github.com/apache/beam/pull/13984
1. Moved the cleanup mock for the flaky test down to the statement we
want to check instead of placing an assert_not_called before the
statement that we cannot guarantee in the testing environment.
2. The culprit statement could be the `set_cache_manager` when in the
testing environment, the global singleton ie.current_env() holds a
non empty cache manager for some reason while a new cache manager
set would trigger a cleanup.
3. Moved some of the set_cache_manager tests to use local
InteractiveEnvironment instance rather than the global one.
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [ ] [**Choose
reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and
mention them in a comment (`R: @username`).
- [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in
ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA
issue, if applicable. This will automatically link the pull request to the
issue.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more
tips on [how to make review process
smoother](https://beam.apache.org/contribute/#make-reviewers-job-easier).
Post-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
Lang | SDK | Dataflow | Flink | Samza | Spark | Twister2
--- | --- | --- | --- | --- | --- | ---
Go | [](https://ci-beam.apache.org/job/beam_PostCommit_Go/lastCompletedBuild/)
| --- | [](https://ci-beam.apache.org/job/beam_PostCommit_Go_VR_Flink/lastCompletedBuild/)
| --- | [](https://ci-beam.apache.org/job/beam_PostCommit_Go_VR_Spark/lastCompletedBuild/)
| ---
Java | [](https://ci-beam.apache.org/job/beam_PostCommit_Java/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_VR_Dataflow_V2/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Java11/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Java11/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Flink_Batch/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Flink_Streaming/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_PVR_Spark_Batch/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_SparkStructuredStreaming/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Twister2/lastCompletedBuild/)
Python | [](https://ci-beam.apache.org/job/beam_PostCommit_Python36/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Python37/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Python38/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Py_VR_Dataflow_V2/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PreCommit_Python_PVR_Flink_Cron/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PostCommit_Python_VR_Flink/lastCompletedBuild/)
| --- | [](https://ci-beam.apache.org/job/beam_PostCommit_Python_VR_Spark/lastCompletedBuild/)
| ---
XLang | [](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Direct/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Dataflow/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Flink/lastCompletedBuild/)
| --- | [](https://ci-beam.apache.org/job/beam_PostCommit_XVR_Spark/lastCompletedBuild/)
| ---
Pre-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
--- |Java | Python | Go | Website | Whitespace | Typescript
--- | --- | --- | --- | --- | --- | ---
Non-portable | [](https://ci-beam.apache.org/job/beam_PreCommit_Java_Cron/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PreCommit_PythonLint_Cron/lastCompletedBuild/)<br>[](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocker_Cron/lastCompletedBuild/)
<br>[](https://ci-beam.apache.org/job/beam_PreCommit_PythonDocs_Cron/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PreCommit_Go_Cron/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PreCommit_Website_Cron/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PreCommit_Whitespace_Cron/lastCompletedBuild/)
| [](https://ci-beam.apache.org/job/beam_PreCommit_Typescript_Cron/lastCompletedBuild/)
Portable | --- | [](https://ci-beam.apache.org/job/beam_PreCommit_Portable_Python_Cron/lastCompletedBuild/)
| --- | --- | --- | ---
See
[.test-infra/jenkins/README](https://github.com/apache/beam/blob/master/.test-infra/jenkins/README.md)
for trigger phrase, status and link of all Jenkins jobs.
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more
information about GitHub Actions CI.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 551960)
Time Spent: 4h (was: 3h 50m)
> flaky test: test_track_user_pipeline_cleanup_non_inspectable_pipeline
> ---------------------------------------------------------------------
>
> Key: BEAM-11476
> URL: https://issues.apache.org/jira/browse/BEAM-11476
> Project: Beam
> Issue Type: Bug
> Components: sdk-py-core
> Reporter: Udi Meiri
> Assignee: Ning Kang
> Priority: P1
> Labels: currently-failing, flake
> Time Spent: 4h
> Remaining Estimate: 0h
>
> Test name:
> apache_beam.runners.interactive.interactive_environment_test.InteractiveEnvironmentTest.test_track_user_pipeline_cleanup_non_inspectable_pipeline
> {code}
> Error Message
> AssertionError: Expected 'cleanup' to not have been called. Called 1 times.
> Stacktrace
> self =
> <apache_beam.runners.interactive.interactive_environment_test.InteractiveEnvironmentTest
> testMethod=test_track_user_pipeline_cleanup_non_inspectable_pipeline>
> mocked_cleanup = <MagicMock name='cleanup' id='140386685111432'>
> @patch(
> 'apache_beam.runners.interactive.interactive_environment'
> '.InteractiveEnvironment.cleanup')
> def test_track_user_pipeline_cleanup_non_inspectable_pipeline(
> self, mocked_cleanup):
> ie._interactive_beam_env = None
> ie.new_env()
> dummy_pipeline_1 = beam.Pipeline()
> dummy_pipeline_2 = beam.Pipeline()
> dummy_pipeline_3 = beam.Pipeline()
> dummy_pipeline_4 = beam.Pipeline()
> dummy_pcoll = dummy_pipeline_4 | beam.Create([1])
> dummy_pipeline_5 = beam.Pipeline()
> dummy_non_inspectable_pipeline = 'dummy'
> ie.current_env().watch(locals())
> from apache_beam.runners.interactive.background_caching_job import
> BackgroundCachingJob
> ie.current_env().set_background_caching_job(
> dummy_pipeline_1,
> BackgroundCachingJob(
> runner.PipelineResult(runner.PipelineState.DONE), limiters=[]))
> ie.current_env().set_test_stream_service_controller(dummy_pipeline_2,
> None)
> ie.current_env().set_cache_manager(
> cache.FileBasedCacheManager(), dummy_pipeline_3)
> ie.current_env().mark_pcollection_computed([dummy_pcoll])
> ie.current_env().set_cached_source_signature(
> dummy_non_inspectable_pipeline, None)
> ie.current_env().set_pipeline_result(
> dummy_pipeline_5,
> runner.PipelineResult(runner.PipelineState.RUNNING))
> > mocked_cleanup.assert_not_called()
> apache_beam/runners/interactive/interactive_environment_test.py:265:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _
> _mock_self = <MagicMock name='cleanup' id='140386685111432'>
> def assert_not_called(_mock_self):
> """assert that the mock was never called.
> """
> self = _mock_self
> if self.call_count != 0:
> msg = ("Expected '%s' to not have been called. Called %s times." %
> (self._mock_name or 'mock', self.call_count))
> > raise AssertionError(msg)
> E AssertionError: Expected 'cleanup' to not have been called.
> Called 1 times.
> /usr/lib/python3.7/unittest/mock.py:792: AssertionError
> {code}
> https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/3609/
> https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/3607/
> https://ci-beam.apache.org/job/beam_PreCommit_Python_Cron/3593/
--
This message was sent by Atlassian Jira
(v8.3.4#803005)