-
Notifications
You must be signed in to change notification settings - Fork 0
How the test launcher runs Jobs
Alan B. Christie edited this page Aug 15, 2025
·
6 revisions
The test InstanceLauncher is responsible for a number of actions when the engine under test calls launch(), which…
- Creates a simulated Instance database record and sets its
running_workflow_idto the given RunningWorkflowStep UUID. This is done because it is important for the engine, which will need to find an instance UUID in the corresponding PodMessage that it expects to receive - The step’s Job definition is retrieved via the workflow API using the LaunchParameter’s
specification. This gives the instance launcher the Job’s command (which may depend on some provided variables) - The variables provided in the LaunchParameter’s
specification_variablesare applied to the Job’s command. This ensures any variables expected in the command are expanded using the values the engine had provided - The decoded command is executed using
subprocess.run()usingtests/jobsas the execution directory while ehe launcher collects the subprocess command’s exit code - A PodMessage protocol buffer is constructed and populated. Its
phaseis set to Completed.instance_idis set to the UUID of the instance just created.task_idis set to a dummy Task UUID.has_exit_codeis set to True, and theexit_codeis set to the exit code of the subprocess that was just run - The constructed message is sent to the message queue using the message dispatcher. This message is eventually (almost immediately) passed on to the engine’s
handle_message()method
Finally the UUID of the instance record that was created along with a dummy (meaningless) task UUID, and the decoded command are returned to the caller.