code: def test_wait_all(
      self, deliver1_offset, deliver2_offset, expected, elapsed
  ):
      def on_progress_all(progress_all_handle):
          pass
  
      with self._patch_mailbox() as (
          event_mock,
          event_all_mock,
      ):
          mailbox = Mailbox()
          handle1 = mailbox.get_handle()
          handle2 = mailbox.get_handle()
  
          result1 = pb.Result()
          result1.control.mailbox_slot = handle1.address
          self.time_obj.add_timed_event(
              deliver1_offset, lambda: mailbox.deliver(result1)
          )
  
          result2 = pb.Result()
          result2.control.mailbox_slot = handle2.address
          self.time_obj.add_timed_event(
              deliver2_offset, lambda: mailbox.deliver(result2)
          )
  
          got = mailbox.wait_all(
              [handle1, handle2],
              on_progress_all=on_progress_all,
              timeout=8,
          )
          self.assertEqual(got, expected)
          self.assertEqual(self.time_obj.elapsed_time, elapsed)
  
imports: import sys
  import threading
  import time
  from contextlib import contextmanager
  from unittest import TestCase
  from unittest.mock import Mock, patch
  from parameterized import parameterized
  from wandb.proto import wandb_internal_pb2
  from wandb.sdk.lib.mailbox import Mailbox, MailboxProbe, MailboxProgress
label_desc: Use image node_id 8 for calling the TestWithMockedTime obj's underlying member method code with example usage: obj.test_wait_all(deliver1_offset, deliver2_offset, expected, elapsed) without return types