aurora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sweeney (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AURORA-101) aurora diff test is flaky
Date Thu, 23 Jan 2014 23:56:38 GMT

     [ https://issues.apache.org/jira/browse/AURORA-101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kevin Sweeney updated AURORA-101:
---------------------------------

    Description: 
I have a DIFF_VIEWER environment variable set for "aurora diff".

{noformat}
============================================= FAILURES =============================================
_______________________________ TestDiffCommand.test_successful_diff _______________________________

self = <test_diff.TestDiffCommand testMethod=test_successful_diff>

    def test_successful_diff(self):
      """Test the diff command."""
      mock_options = self.setup_mock_options()
      (mock_api, mock_scheduler) = self.create_mock_api()
      mock_scheduler.getTasksStatus.return_value = self.create_status_response()
      self.setup_populate_job_config(mock_scheduler)
      with contextlib.nested(
          patch('twitter.aurora.client.api.SchedulerProxy', return_value=mock_scheduler),
          patch('twitter.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS),
          patch('twitter.common.app.get_options', return_value=mock_options),
          patch('subprocess.call', return_value=0),
          patch('json.loads', return_value=Mock())) as (
              mock_scheduler_proxy_class,
              mock_clusters,
              options,
              subprocess_patch,
              json_patch):
        with temporary_file() as fp:
          fp.write(self.get_valid_config())
          fp.flush()
          diff(['west/mchucarroll/test/hello', fp.name])
    
          # Diff should get the task status, populate a config, and run diff.
          mock_scheduler.getTasksStatus.assert_called_with(
              TaskQuery(jobName='hello', environment='test', owner=Identity(role='mchucarroll'),
                  statuses=set([ScheduleStatus.PENDING, ScheduleStatus.STARTING,
                      ScheduleStatus.RUNNING, ScheduleStatus.KILLING, ScheduleStatus.ASSIGNED,
                      ScheduleStatus.RESTARTING, ScheduleStatus.PREEMPTING])))
          assert mock_scheduler.populateJobConfig.call_count == 1
          assert isinstance(mock_scheduler.populateJobConfig.call_args[0][0], JobConfiguration)
          assert (mock_scheduler.populateJobConfig.call_args[0][0].key ==
              JobKey(environment=u'test', role=u'mchucarroll', name=u'hello'))
          # Subprocess should have been used to invoke diff with two parameters.
          assert subprocess_patch.call_count == 1
          assert len(subprocess_patch.call_args[0][0]) == 3
>         assert subprocess_patch.call_args[0][0][0] == 'diff'
E         AssertionError: assert 'gdiff' == 'diff'
E           - gdiff
E           ? -
E           + diff

src/test/python/twitter/aurora/client/commands/test_diff.py:125: AssertionError
=============================== 1 failed, 23 passed in 1.05 seconds ================================
{noformat}

  was:
I have a DIFF_VIEWER environment variable set for "mesos diff".

{noformat}
============================================= FAILURES =============================================
_______________________________ TestDiffCommand.test_successful_diff _______________________________

self = <test_diff.TestDiffCommand testMethod=test_successful_diff>

    def test_successful_diff(self):
      """Test the diff command."""
      mock_options = self.setup_mock_options()
      (mock_api, mock_scheduler) = self.create_mock_api()
      mock_scheduler.getTasksStatus.return_value = self.create_status_response()
      self.setup_populate_job_config(mock_scheduler)
      with contextlib.nested(
          patch('twitter.aurora.client.api.SchedulerProxy', return_value=mock_scheduler),
          patch('twitter.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS),
          patch('twitter.common.app.get_options', return_value=mock_options),
          patch('subprocess.call', return_value=0),
          patch('json.loads', return_value=Mock())) as (
              mock_scheduler_proxy_class,
              mock_clusters,
              options,
              subprocess_patch,
              json_patch):
        with temporary_file() as fp:
          fp.write(self.get_valid_config())
          fp.flush()
          diff(['west/mchucarroll/test/hello', fp.name])
    
          # Diff should get the task status, populate a config, and run diff.
          mock_scheduler.getTasksStatus.assert_called_with(
              TaskQuery(jobName='hello', environment='test', owner=Identity(role='mchucarroll'),
                  statuses=set([ScheduleStatus.PENDING, ScheduleStatus.STARTING,
                      ScheduleStatus.RUNNING, ScheduleStatus.KILLING, ScheduleStatus.ASSIGNED,
                      ScheduleStatus.RESTARTING, ScheduleStatus.PREEMPTING])))
          assert mock_scheduler.populateJobConfig.call_count == 1
          assert isinstance(mock_scheduler.populateJobConfig.call_args[0][0], JobConfiguration)
          assert (mock_scheduler.populateJobConfig.call_args[0][0].key ==
              JobKey(environment=u'test', role=u'mchucarroll', name=u'hello'))
          # Subprocess should have been used to invoke diff with two parameters.
          assert subprocess_patch.call_count == 1
          assert len(subprocess_patch.call_args[0][0]) == 3
>         assert subprocess_patch.call_args[0][0][0] == 'diff'
E         AssertionError: assert 'gdiff' == 'diff'
E           - gdiff
E           ? -
E           + diff

src/test/python/twitter/aurora/client/commands/test_diff.py:125: AssertionError
=============================== 1 failed, 23 passed in 1.05 seconds ================================
{noformat}


> aurora diff test is flaky
> -------------------------
>
>                 Key: AURORA-101
>                 URL: https://issues.apache.org/jira/browse/AURORA-101
>             Project: Aurora
>          Issue Type: Bug
>          Components: Client
>            Reporter: Kevin Sweeney
>
> I have a DIFF_VIEWER environment variable set for "aurora diff".
> {noformat}
> ============================================= FAILURES =============================================
> _______________________________ TestDiffCommand.test_successful_diff _______________________________
> self = <test_diff.TestDiffCommand testMethod=test_successful_diff>
>     def test_successful_diff(self):
>       """Test the diff command."""
>       mock_options = self.setup_mock_options()
>       (mock_api, mock_scheduler) = self.create_mock_api()
>       mock_scheduler.getTasksStatus.return_value = self.create_status_response()
>       self.setup_populate_job_config(mock_scheduler)
>       with contextlib.nested(
>           patch('twitter.aurora.client.api.SchedulerProxy', return_value=mock_scheduler),
>           patch('twitter.aurora.client.factory.CLUSTERS', new=self.TEST_CLUSTERS),
>           patch('twitter.common.app.get_options', return_value=mock_options),
>           patch('subprocess.call', return_value=0),
>           patch('json.loads', return_value=Mock())) as (
>               mock_scheduler_proxy_class,
>               mock_clusters,
>               options,
>               subprocess_patch,
>               json_patch):
>         with temporary_file() as fp:
>           fp.write(self.get_valid_config())
>           fp.flush()
>           diff(['west/mchucarroll/test/hello', fp.name])
>     
>           # Diff should get the task status, populate a config, and run diff.
>           mock_scheduler.getTasksStatus.assert_called_with(
>               TaskQuery(jobName='hello', environment='test', owner=Identity(role='mchucarroll'),
>                   statuses=set([ScheduleStatus.PENDING, ScheduleStatus.STARTING,
>                       ScheduleStatus.RUNNING, ScheduleStatus.KILLING, ScheduleStatus.ASSIGNED,
>                       ScheduleStatus.RESTARTING, ScheduleStatus.PREEMPTING])))
>           assert mock_scheduler.populateJobConfig.call_count == 1
>           assert isinstance(mock_scheduler.populateJobConfig.call_args[0][0], JobConfiguration)
>           assert (mock_scheduler.populateJobConfig.call_args[0][0].key ==
>               JobKey(environment=u'test', role=u'mchucarroll', name=u'hello'))
>           # Subprocess should have been used to invoke diff with two parameters.
>           assert subprocess_patch.call_count == 1
>           assert len(subprocess_patch.call_args[0][0]) == 3
> >         assert subprocess_patch.call_args[0][0][0] == 'diff'
> E         AssertionError: assert 'gdiff' == 'diff'
> E           - gdiff
> E           ? -
> E           + diff
> src/test/python/twitter/aurora/client/commands/test_diff.py:125: AssertionError
> =============================== 1 failed, 23 passed in 1.05 seconds ================================
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message