You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Valentyn Tymofieiev (Jira)" <ji...@apache.org> on 2020/01/24 19:46:00 UTC

[jira] [Commented] (BEAM-9183) apache_beam.options.pipeline_options_test.PipelineOptionsTest.test_value_provider_options is flaky in precommits

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

Valentyn Tymofieiev commented on BEAM-9183:
-------------------------------------------

Stacktrace:
{noformat}
self = <apache_beam.options.pipeline_options_test.PipelineOptionsTest testMethod=test_value_provider_options>

    def test_value_provider_options(self):
      class UserOptions(PipelineOptions):
        @classmethod
        def _add_argparse_args(cls, parser):
          parser.add_value_provider_argument(
              '--pot_vp_arg1',
              help='This flag is a value provider')
    
          parser.add_value_provider_argument(
              '--pot_vp_arg2',
              default=1,
              type=int)
    
          parser.add_argument(
              '--pot_non_vp_arg1',
              default=1,
              type=int
          )
    
      # Provide values: if not provided, the option becomes of the type runtime vp
      options = UserOptions(['--pot_vp_arg1', 'hello'])
      self.assertIsInstance(options.pot_vp_arg1, StaticValueProvider)
      self.assertIsInstance(options.pot_vp_arg2, RuntimeValueProvider)
      self.assertIsInstance(options.pot_non_vp_arg1, int)
    
      # Values can be overwritten
      options = UserOptions(pot_vp_arg1=5,
                            pot_vp_arg2=StaticValueProvider(value_type=str,
                                                            value='bye'),
                            pot_non_vp_arg1=RuntimeValueProvider(
                                option_name='foo',
                                value_type=int,
                                default_value=10))
      self.assertEqual(options.pot_vp_arg1, 5)
      self.assertTrue(options.pot_vp_arg2.is_accessible(),
                      '%s is not accessible' % options.pot_vp_arg2)
      self.assertEqual(options.pot_vp_arg2.get(), 'bye')
>     self.assertFalse(options.pot_non_vp_arg1.is_accessible())
E     AssertionError: True is not false

apache_beam/options/pipeline_options_test.py:426: AssertionError
{noformat}


> apache_beam.options.pipeline_options_test.PipelineOptionsTest.test_value_provider_options is flaky in precommits
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: BEAM-9183
>                 URL: https://issues.apache.org/jira/browse/BEAM-9183
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core, test-failures
>            Reporter: Valentyn Tymofieiev
>            Priority: Major
>              Labels: currently-failing
>
> The test appears to fail in -pytest environments on precommits on several PRs:
> https://builds.apache.org/job/beam_PreCommit_Python_Phrase/1402
> https://builds.apache.org/job/beam_PreCommit_Python_Phrase/1397/
> https://builds.apache.org/job/beam_PreCommit_Python_Phrase/1405
> I was not able to reproduce it locally via: 
> - python ./setup.py test -s apache_beam.options.pipeline_options_test
> - tox -e py27-cython-pytest
>  - pytest apache_beam/options/pipeline_options_test.py
> Not sure what's happening.



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