def test_thread_group_waits_threads(self):
        # That can fail with some probability, so making 5 attempts
        # Actually it takes around 1 second, so maybe we should
        # just remove it
        for _ in six.moves.range(5):
            lst = []

            with context.ThreadGroup() as tg:
                for i in six.moves.range(400):
                    tg.spawn(i % 'add %i', self._add_element, lst, i)

            self.assertEqual(400, len(lst))
dataset/ETHPy150Open openstack/sahara/sahara/tests/unit/test_context.py/ContextTest.test_thread_group_waits_threads/swapped operands of `%`