code: def test_multiple_events_by_http(workflow_start_regular_shared_serve):
      """If a workflow has multiple event arguments, it should wait for them at the
      same time.
      """
  
      def send_event1():
          resp = requests.post(
              "http://127.0.0.1:8000/event/send_event/"
              + "workflow_test_multiple_event_by_http",
              json={"event_key": "e1", "event_payload": "hello"},
          )
          return resp
  
      def send_event2():
          sleep(0.5)
          resp = requests.post(
              "http://127.0.0.1:8000/event/send_event/"
              + "workflow_test_multiple_event_by_http",
              json={"event_key": "e2", "event_payload": "world"},
          )
          return resp
  
      @ray.remote
      def trivial_task(arg1, arg2):
          return f"{arg1[1]} {arg2[1]}"
  
      event1_promise = workflow.wait_for_event(
          HTTPListener, event_key="e1"
      )
      event2_promise = workflow.wait_for_event(
          HTTPListener, event_key="e2"
      )
      workflow.run_async(
          trivial_task.bind(event1_promise, event2_promise),
          workflow_id="workflow_test_multiple_event_by_http",
      )
  
      # wait until HTTPEventProvider is ready
      def check_app_running():
          status = serve.status().applications[
              common.HTTP_EVENT_PROVIDER_NAME
          ]
          assert status.status == "RUNNING"
          return True
  
      wait_for_condition(check_app_running)
  
      # repeat send_event1() until the returned status code is not 404
      while True:
          res = send_event1()
          if res.status_code == 404:
              sleep(0.5)
          else:
              break
  
      while True:
          res = send_event2()
          if res.status_code == 404:
              sleep(0.5)
          else:
              break
  
      event_msg = workflow.get_output(
          workflow_id="workflow_test_multiple_event_by_http"
      )
  
      assert event_msg == "hello world"
  
file_path: ray/python/ray/workflow/tests/test_http_events_2.py
imports: from time import sleep
  import pytest
  import ray
  from ray import workflow
  from ray.workflow.http_event_provider import HTTPListener
  from ray.tests.conftest import *
  from ray import serve
  from ray.workflow import common
  from ray._private.test_utils import wait_for_condition
  import requests
label_desc: Use image node_id 1 for calling a global function with example usage: test_multiple_events_by_http(workflow_start_regular_shared_serve) and returns: resp, resp, arg1, str, arg2, True