Pārlūkot izejas kodu

Merge branch 'rogerhu/suite_fun3' into 3.1

Ask Solem 11 gadi atpakaļ
vecāks
revīzija
ffc15fb565

+ 7 - 0
funtests/stress/README.rst

@@ -153,6 +153,13 @@ See ``python -m stress --help`` for a list of all available options.
 Options
 =======
 
+Using a different broker
+------------------------
+You can set the environment ``CSTRESS_BROKER`` to change the broker used::
+
+    $ CSTRESS_BROKER='amqp://' celery -A stress worker # …
+    $ CSTRESS_BROKER='amqp://' python -m stress
+
 Using a different result backend
 --------------------------------
 

+ 1 - 1
funtests/stress/stress/app.py

@@ -116,7 +116,7 @@ def retries(self):
 
 
 @app.task
-def unicode():
+def print_unicode():
     print('hiöäüß')
 
 

+ 2 - 2
funtests/stress/stress/suite.py

@@ -20,7 +20,7 @@ from celery.utils.timeutils import humanize_seconds
 
 from .app import (
     marker, _marker, add, any_, exiting, kill, sleeping,
-    sleeping_ignore_limits, segfault, any_returning,
+    sleeping_ignore_limits, segfault, any_returning, print_unicode
 )
 from .data import BIG, SMALL
 from .fbi import FBI
@@ -168,7 +168,7 @@ class Suite(object):
         )
 
     def manyshort(self):
-        self.join(group(add.s(i, i) for i in range(1000))(),
+        self.join(group(print_unicode.s() for i in range(1000))(),
                   timeout=10, propagate=True)
 
     def runtest(self, fun, n=50, index=0, repeats=1):