mirror of https://github.com/zulip/zulip.git
Replace 'flaky' and 'freaking out' with less personified words.
The tests to recognize a misbehaving/unpredictable worker task use the words 'flaky' and 'freaking out' in personifying the system behavior. This terminology isn't inclusive of people with mental health issues or mood disorders, so this change updates the wording to have less personification and more objective system description. (http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1925070/)
This commit is contained in:
parent
fb5192e85b
commit
8e429759e2
|
@ -242,11 +242,11 @@ class WorkerTest(TestCase):
|
|||
def test_error_handling(self):
|
||||
processed = []
|
||||
|
||||
@queue_processors.assign_queue('flake')
|
||||
class FlakyWorker(queue_processors.QueueProcessingWorker):
|
||||
@queue_processors.assign_queue('unreliable_worker')
|
||||
class UnreliableWorker(queue_processors.QueueProcessingWorker):
|
||||
def consume(self, data):
|
||||
if data == 'freak out':
|
||||
raise Exception('Freaking out!')
|
||||
if data == 'unexpected behaviour':
|
||||
raise Exception('Worker task not performing as expected!')
|
||||
processed.append(data)
|
||||
|
||||
def _log_problem(self):
|
||||
|
@ -254,23 +254,23 @@ class WorkerTest(TestCase):
|
|||
pass
|
||||
|
||||
fake_client = self.FakeClient()
|
||||
for msg in ['good', 'fine', 'freak out', 'back to normal']:
|
||||
fake_client.queue.append(('flake', msg))
|
||||
for msg in ['good', 'fine', 'unexpected behaviour', 'back to normal']:
|
||||
fake_client.queue.append(('unreliable_worker', msg))
|
||||
|
||||
fn = os.path.join(settings.QUEUE_ERROR_DIR, 'flake.errors')
|
||||
fn = os.path.join(settings.QUEUE_ERROR_DIR, 'unreliable_worker.errors')
|
||||
try:
|
||||
os.remove(fn)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
with simulated_queue_client(lambda: fake_client):
|
||||
worker = FlakyWorker()
|
||||
worker = UnreliableWorker()
|
||||
worker.start()
|
||||
|
||||
self.assertEqual(processed, ['good', 'fine', 'back to normal'])
|
||||
line = open(fn).readline().strip()
|
||||
event = ujson.loads(line.split('\t')[1])
|
||||
self.assertEqual(event, 'freak out')
|
||||
self.assertEqual(event, 'unexpected behaviour')
|
||||
|
||||
class ActivityTest(AuthedTestCase):
|
||||
def test_activity(self):
|
||||
|
|
Loading…
Reference in New Issue