def testRerunBeforeContinue(self):
    @gen.coroutine
    def _NextOpMethod(client):
      # Multiply the method count, which tells us if this was called before or after the 2nd call
      # to _FlakyOpMethod.
      self._method_count *= 4

    @gen.coroutine
    def _FlakyOpMethod(client):
      # Fail 1st to attempts, and succeed on the 3rd.
      self._method_count += 1
      if self._method_count <= 2:
        raise Exception('some transient failure')

    # Create two operations and ensure that first is re-run before second is completed.
    op = self._CreateTestOp(user_id=1, handler=_FlakyOpMethod)
    op2 = self._CreateTestOp(user_id=1, handler=_NextOpMethod)
    user_op_mgr = self._CreateUserOpManager(user_id=1, handlers=[_FlakyOpMethod, _NextOpMethod], callback=self.stop)
    user_op_mgr.Execute()
    self.wait()
    self.assertEqual(self._method_count, 12)

    # Ensure that all operations completed and were deleted.
    self.assertEqual(self._RunAsync(Operation.RangeQuery, self._client, 1, None, None, None), [])
Rename an existing composite
dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/test/op_manager_test.py/OpManagerTestCase.testRerunBeforeContinue--crossover with--dataset/ETHPy150Open perseas/Pyrseas/tests/dbobject/test_type.py/CompositeToSqlTestCase.test_rename_composite