You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Robert Bradshaw (Jira)" <ji...@apache.org> on 2021/02/11 01:44:00 UTC

[jira] [Commented] (BEAM-11797) Flaky interactive test in Precommit

    [ https://issues.apache.org/jira/browse/BEAM-11797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17282831#comment-17282831 ] 

Robert Bradshaw commented on BEAM-11797:
----------------------------------------

self = <apache_beam.runners.interactive.utils_test.ProgressIndicatorTest testMethod=test_progress_in_HTML_JS_when_in_notebook>
mocked_display_javascript = <MagicMock name='display_javascript' id='139743144054856'>
mocked_display = <MagicMock name='display' id='139743144055136'>
mocked_javascript = <MagicMock name='Javascript' id='139743144054912'>
mocked_html = <MagicMock name='HTML' id='139742992798328'>

    @patch('IPython.core.display.HTML')
    @patch('IPython.core.display.Javascript')
    @patch('IPython.core.display.display')
    @patch('IPython.core.display.display_javascript')
    def test_progress_in_HTML_JS_when_in_notebook(
        self,
        mocked_display_javascript,
        mocked_display,
        mocked_javascript,
        mocked_html):
    
      ie.current_env()._is_in_notebook = True
      mocked_display.assert_not_called()
      mocked_display_javascript.assert_not_called()
    
      @utils.progress_indicated
      def progress_indicated_dummy():
        mocked_display.assert_called_once()
        mocked_html.assert_called_once()
    
>     progress_indicated_dummy()

apache_beam/runners/interactive/utils_test.py:232: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
apache_beam/runners/interactive/utils.py:228: in run_within_progress_indicator
    return func(*args, **kwargs)
apache_beam/runners/interactive/utils_test.py:229: in progress_indicated_dummy
    mocked_display.assert_called_once()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

_mock_self = <MagicMock name='display' id='139743144055136'>

    def assert_called_once(_mock_self):
        """assert that the mock was called only once.
        """
        self = _mock_self
        if not self.call_count == 1:
            msg = ("Expected '%s' to have been called once. Called %s times." %
                   (self._mock_name or 'mock', self.call_count))
>           raise AssertionError(msg)
E           AssertionError: Expected 'display' to have been called once. Called 2 times.

/usr/lib/python3.6/unittest/mock.py:795: AssertionError


> Flaky interactive test in Precommit
> -----------------------------------
>
>                 Key: BEAM-11797
>                 URL: https://issues.apache.org/jira/browse/BEAM-11797
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core, testing
>            Reporter: Robert Bradshaw
>            Priority: P2
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)