Control: tags -1 + patch

On 2013-10-06 20:54:27, David Suárez wrote:
> Relevant part (hopefully):
> > ======================================================================
> > ERROR: test_set_many 
> > (werkzeug.testsuite.contrib.cache.MemcachedCacheTestCase)
> > ----------------------------------------------------------------------
> > Traceback (most recent call last):
> >   File 
> > "/«BUILDDIR»/python-werkzeug-0.9.3+dfsg/werkzeug/testsuite/__init__.py", 
> > line 76, in tearDown
> >     self.teardown()
> >   File 
> > "/«BUILDDIR»/python-werkzeug-0.9.3+dfsg/werkzeug/testsuite/contrib/cache.py",
> >  line 180, in teardown
> >     self.make_cache().clear()
> >   File "/«BUILDDIR»/python-werkzeug-0.9.3+dfsg/werkzeug/contrib/cache.py", 
> > line 405, in clear
> >     self._client.flush_all()
> > SomeErrors: error 19 from flush_all: (27114352) CONNECTION 
> > FAILURE(Connection refused), host: 127.0.0.1:11211 -> 
> > libmemcached/connect.cc:127
> > 
> > ======================================================================
> > ERROR: test_true_false 
> > (werkzeug.testsuite.contrib.cache.MemcachedCacheTestCase)
> > ----------------------------------------------------------------------
> > Traceback (most recent call last):
> >   File 
> > "/«BUILDDIR»/python-werkzeug-0.9.3+dfsg/werkzeug/testsuite/contrib/cache.py",
> >  line 243, in test_true_false
> >     c.set('foo', True)
> >   File "/«BUILDDIR»/python-werkzeug-0.9.3+dfsg/werkzeug/contrib/cache.py", 
> > line 367, in set
> >     self._client.set(key, value, timeout)
> > ConnectionError: error 3 from memcached_set: (27105216) CONNECTION 
> > FAILURE(Connection refused), host: 127.0.0.1:11211 -> 
> > libmemcached/connect.cc:127
> > 
> > ======================================================================
> > ERROR: test_true_false 
> > (werkzeug.testsuite.contrib.cache.MemcachedCacheTestCase)
> > ----------------------------------------------------------------------
> > Traceback (most recent call last):
> >   File 
> > "/«BUILDDIR»/python-werkzeug-0.9.3+dfsg/werkzeug/testsuite/__init__.py", 
> > line 76, in tearDown
> >     self.teardown()
> >   File 
> > "/«BUILDDIR»/python-werkzeug-0.9.3+dfsg/werkzeug/testsuite/contrib/cache.py",
> >  line 180, in teardown
> >     self.make_cache().clear()
> >   File "/«BUILDDIR»/python-werkzeug-0.9.3+dfsg/werkzeug/contrib/cache.py", 
> > line 405, in clear
> >     self._client.flush_all()
> > SomeErrors: error 19 from flush_all: (27116448) CONNECTION 
> > FAILURE(Connection refused), host: 127.0.0.1:11211 -> 
> > libmemcached/connect.cc:127
> > 
> > ----------------------------------------------------------------------
> > Ran 330 tests in 1.704s
> > 
> > FAILED (errors=20)
> > E: pybuild pybuild:255: test: plugin distutils failed with: exit code=1: 
> > python2.7 setup.py test 
> > dh_auto_test: pybuild --test -i python{version} -p 2.7 --dir . returned 
> > exit code 13

And a bit earlier in the log:
| Setting up memcached (1.4.13-0.2) ...
| All runlevel operations denied by policy
| invoke-rc.d: policy-rc.d denied execution of start.

The problem here is that in a default schroot/sbuild environment,
memcached won't be running since it's explicitely disabled via
/usr/sbin/policy-rc.d. In this situation memcached needs to be started
explicitely before running the test suite. Something like the attached
patch could be used to launch memcached, run the test suite and kill
memcached after it completed. It should work in both cases when another
memcached is already running and when there is no memcached running.

Regards
-- 
Sebastian Ramacher
diff -Nru python-werkzeug-0.9.4+dfsg/debian/rules python-werkzeug-0.9.4+dfsg/debian/rules
--- python-werkzeug-0.9.4+dfsg/debian/rules	2013-08-08 21:52:30.000000000 +0200
+++ python-werkzeug-0.9.4+dfsg/debian/rules	2013-12-07 04:15:32.000000000 +0100
@@ -19,7 +19,10 @@
 	dh_auto_clean
 
 override_dh_auto_test:
-	http_proxy='' dh_auto_test
+	set -ex; \
+		memcached -p 11211 -l 127.0.0.1 & \
+		trap "kill $$! || true" EXIT; \
+		http_proxy='' dh_auto_test; \
 
 override_dh_auto_install:
 	dh_auto_install

Attachment: signature.asc
Description: Digital signature

Reply via email to