code: def test_event_during_arg_resolution(workflow_start_regular_shared):
      """If a workflow's arguments are being executed when the event occurs, the
      workflow should run immediately with no issues.
      """
  
      class MyEventListener(workflow.EventListener):
          async def poll_for_event(self):
              while not utils.check_global_mark():
                  await asyncio.sleep(0.1)
              utils.set_global_mark("event_returning")
  
      @ray.remote
      def triggers_event():
          utils.set_global_mark()
          while not utils.check_global_mark("event_returning"):
              time.sleep(0.1)
  
      @ray.remote
      def gather(*args):
          return args
  
      event_promise = workflow.wait_for_event(MyEventListener)
      assert workflow.run(
          gather.bind(event_promise, triggers_event.bind())
      ) == (
          None,
          None,
      )
  
file_path: ray/python/ray/workflow/tests/test_events.py
imports: import asyncio
  import time
  import pytest
  import ray
  from ray import workflow
  from ray.tests.conftest import *
  from ray.workflow.tests import utils
label_desc: Use image node_id 5 for calling a global function with example usage: test_event_during_arg_resolution(workflow_start_regular_shared) and returns: args