code: def _test_then_error(self, cb, errMsg):
      fut = Future[int]()
      then_fut = fut.then(cb)
  
      fut.set_result(5)
      self.assertEqual(5, fut.wait())
      with self.assertRaisesRegex(RuntimeError, errMsg):
          then_fut.wait()
  
imports: import threading
  import time
  import torch
  import unittest
  from torch.futures import Future
  from torch.testing._internal.common_utils import IS_WINDOWS, TestCase, TemporaryFileName, run_tests
  from typing import TypeVar
label_desc: Use image node_id 11 for calling the TestFuture obj's underlying member method code with example usage: obj._test_then_error(cb, errMsg) without return types