[
https://issues.apache.org/jira/browse/AURORA-682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14121067#comment-14121067
]
Joe Smith commented on AURORA-682:
----------------------------------
Some more data (read up on [Method Resolution Order thanks to a post from
guido|http://python-history.blogspot.com/2010/06/method-resolution-order.html]),
but if anything this seems to corroborate that we *never* should be hitting
Thread's property instead of our defined method.
Also- I have a terrible feeling that the {{threading._Verbose}} in the MRO
below [hints at Issue 4188 causing the test
hang|http://bugs.python.org/issue4188] when I override threading's
getter/setter for {{name}} within {{HealthCheckerThread}}, but have not
confirmed yet.
{{./src/test/python/apache/aurora/executor/test_thermos_executor.py}}
{code}
for checker in te._chained_checker._status_checkers: # hack
print("MRO FOR CHECKER: %s" % checker.__class__.mro())
print("CHECKER NAME: %s" % checker.name())
assert ('%s.enabled' % checker.name()) in sampled_metrics
{code}
{noformat}
vagrant@192:~/aurora$ sudo ./pants
./src/test/python/apache/aurora/executor:thermos_executor
MRO FOR CHECKER: [<class
'apache.aurora.executor.common.kill_manager.KillManager'>, <class
'apache.aurora.executor.common.status_checker.StatusChecker'>, <class
'twitter.common.metrics.metrics.Observable'>, <class
'twitter.common.lang.Interface'>, <type 'object'>]
CHECKER NAME: kill_manager
MRO FOR CHECKER: [<class
'apache.aurora.executor.common.health_checker.HealthCheckerThread'>, <class
'apache.aurora.executor.common.status_checker.StatusChecker'>, <class
'twitter.common.metrics.metrics.Observable'>, <class
'twitter.common.lang.Interface'>, <class
'twitter.common.exceptions.ExceptionalThread'>, <class 'threading.Thread'>,
<class 'threading._Verbose'>, <type 'object'>]
{noformat}
> Test Break- status checker name property
> ----------------------------------------
>
> Key: AURORA-682
> URL: https://issues.apache.org/jira/browse/AURORA-682
> Project: Aurora
> Issue Type: Bug
> Reporter: Joe Smith
> Priority: Blocker
>
> CI email that's reproducible on our vagrant image:
> {noformat}
> vagrant@192:~/aurora$ sudo ./pants
> ./src/test/python/apache/aurora/executor:thermos_executor
> Build operating on top level addresses:
> set([BuildFileAddress(/home/vagrant/aurora/src/test/python/apache/aurora/executor/BUILD,
> thermos_executor)])
> ====================================================================================================================================================
> test session starts
> =====================================================================================================================================================
> platform linux2 -- Python 2.7.6 -- py-1.4.23 -- pytest-2.6.1
> plugins: cov, timeout
> collected 15 items
> src/test/python/apache/aurora/executor/test_thermos_executor.py
> .......FF......
> ==========================================================================================================================================================
> FAILURES
> ==========================================================================================================================================================
> ________________________________________________________________________________________________________________________________________
> TestThermosExecutor.test_task_health_failed
> _________________________________________________________________________________________________________________________________________
> self = <test_thermos_executor.TestThermosExecutor object at 0x7fa03de55190>
> def test_task_health_failed(self):
> proxy_driver = ProxyDriver()
> with SignalServer(UnhealthyHandler) as port:
> with temporary_dir() as checkpoint_root:
> health_check_config = HealthCheckConfig(initial_interval_secs=0.1,
> interval_secs=0.1)
> _, executor = make_executor(
> proxy_driver,
> checkpoint_root,
> MESOS_JOB(task=SLEEP60,
> health_check_config=health_check_config),
> ports={'health': port},
> fast_status=True,
> > status_providers=(HealthCheckerProvider(),))
> src/test/python/apache/aurora/executor/test_thermos_executor.py:405:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _
> proxy_driver = <test_thermos_executor.ProxyDriver object at 0x7fa03de55450>,
> checkpoint_root = '/tmp/tmpyYqNeQ', task =
> MesosJob(health_check_config=HealthCheckConfig(initial_interval_secs=0.1,
> ...traints=ConstraintList()),
> name=does_not_matter,
> instances=1), ports = {'health': 60604}
> fast_status = True, runner_class = <class
> 'apache.aurora.executor.thermos_task_runner.ThermosTaskRunner'>,
> status_providers =
> (<apache.aurora.executor.common.health_checker.HealthCheckerProvider object
> at 0x7fa03de55890>,)
> def make_executor(
> proxy_driver,
> checkpoint_root,
> task,
> ports={},
> fast_status=False,
> runner_class=ThermosTaskRunner,
> status_providers=()):
>
> status_manager_class = FastStatusManager if fast_status else
> StatusManager
> runner_provider = make_provider(checkpoint_root, runner_class)
> te = FastThermosExecutor(
> runner_provider=runner_provider,
> status_manager_class=status_manager_class,
> sandbox_provider=DefaultTestSandboxProvider,
> status_providers=status_providers,
> )
>
> ExecutorTimeout(te.launched, proxy_driver, timeout=Amount(100,
> Time.MILLISECONDS)).start()
> task_description = make_task(task, assigned_ports=ports, instanceId=0)
> te.launchTask(proxy_driver, task_description)
>
> te.status_manager_started.wait()
> sampled_metrics = te.metrics.sample()
> assert 'kill_manager.enabled' in sampled_metrics
> for checker in te._chained_checker._status_checkers: # hacky
> > assert ('%s.enabled' % checker.name()) in sampled_metrics
> E TypeError: 'str' object is not callable
> src/test/python/apache/aurora/executor/test_thermos_executor.py:204: TypeError
> ----------------------------------------------------------------------------------------------------------------------------------------------------
> Captured stderr call
> ----------------------------------------------------------------------------------------------------------------------------------------------------
> Writing log files to disk in /tmp/tmpAiQgSD
> __________________________________________________________________________________________________________________________________________
> TestThermosExecutor.test_task_health_ok
> ___________________________________________________________________________________________________________________________________________
> self = <test_thermos_executor.TestThermosExecutor object at 0x7fa03dcbf2d0>
> def test_task_health_ok(self):
> proxy_driver = ProxyDriver()
> with SignalServer(HealthyHandler) as port:
> with temporary_dir() as checkpoint_root:
> health_check_config = HealthCheckConfig(initial_interval_secs=0.1,
> interval_secs=0.1)
> _, executor = make_executor(proxy_driver,
> checkpoint_root,
> MESOS_JOB(task=SLEEP2,
> health_check_config=health_check_config),
> ports={'health': port},
> fast_status=True,
> >
> > status_providers=(HealthCheckerProvider(),))
> src/test/python/apache/aurora/executor/test_thermos_executor.py:422:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _
> proxy_driver = <test_thermos_executor.ProxyDriver object at 0x7fa03dcbf310>,
> checkpoint_root = '/tmp/tmpAjs_xw', task =
> MesosJob(health_check_config=HealthCheckConfig(initial_interval_secs=0.1,
> ...traints=ConstraintList()),
> name=does_not_matter,
> instances=1), ports = {'health': 46160}
> fast_status = True, runner_class = <class
> 'apache.aurora.executor.thermos_task_runner.ThermosTaskRunner'>,
> status_providers =
> (<apache.aurora.executor.common.health_checker.HealthCheckerProvider object
> at 0x7fa03dcbf590>,)
> def make_executor(
> proxy_driver,
> checkpoint_root,
> task,
> ports={},
> fast_status=False,
> runner_class=ThermosTaskRunner,
> status_providers=()):
>
> status_manager_class = FastStatusManager if fast_status else
> StatusManager
> runner_provider = make_provider(checkpoint_root, runner_class)
> te = FastThermosExecutor(
> runner_provider=runner_provider,
> status_manager_class=status_manager_class,
> sandbox_provider=DefaultTestSandboxProvider,
> status_providers=status_providers,
> )
>
> ExecutorTimeout(te.launched, proxy_driver, timeout=Amount(100,
> Time.MILLISECONDS)).start()
> task_description = make_task(task, assigned_ports=ports, instanceId=0)
> te.launchTask(proxy_driver, task_description)
>
> te.status_manager_started.wait()
> sampled_metrics = te.metrics.sample()
> assert 'kill_manager.enabled' in sampled_metrics
> for checker in te._chained_checker._status_checkers: # hacky
> > assert ('%s.enabled' % checker.name()) in sampled_metrics
> E TypeError: 'str' object is not callable
> src/test/python/apache/aurora/executor/test_thermos_executor.py:204: TypeError
> ----------------------------------------------------------------------------------------------------------------------------------------------------
> Captured stderr call
> ----------------------------------------------------------------------------------------------------------------------------------------------------
> 127.0.0.1 - - [04/Sep/2014 00:07:27] "GET /health HTTP/1.1" 200 -
> Writing log files to disk in /tmp/tmpAiQgSD
> ============================================================================================================================================
> 2 failed, 13 passed in 16.67 seconds
> ============================================================================================================================================
> src.test.python.apache.aurora.executor.thermos_executor
> ..... FAILURE
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)