From 8e429759e2ed4509e03caed0e5e2056bbbb1d297 Mon Sep 17 00:00:00 2001 From: Kara McNair Date: Thu, 22 Oct 2015 13:29:24 -0400 Subject: [PATCH] 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/) --- zerver/tests.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/zerver/tests.py b/zerver/tests.py index 64819cc61d..242dab5ad4 100644 --- a/zerver/tests.py +++ b/zerver/tests.py @@ -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):