Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WX-757 Fix stdout, stderr in workflow body causing crashes #7386

Merged
merged 9 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version 1.0

workflow break_with_stderr {

output {
File load_data_csv = select_first([stdout(), stderr()])
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: stderr_stdout_workflow_body
testFormat: workflowfailure

files {
workflow: failures/stderr_stdout_workflow_body/stderr_stdout_workflow_body.wdl
}

metadata {
workflowName: break_with_stderr
status: Failed
"failures.0.message": "Workflow failed"
"failures.0.causedBy.0.message": "Failed to evaluate 'break_with_stderr.load_data_csv' (reason 1 of 2): Evaluating select_first([stdout(), stderr()]) failed: stdout is not implemented at the workflow level, Failed to evaluate 'break_with_stderr.load_data_csv' (reason 2 of 2): Evaluating select_first([stdout(), stderr()]) failed: stderr is not implemented at the workflow level"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really appreciate how our error handling reports both errors on the same line!

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
ioFunctionSet: IoFunctionSet,
forCommandInstantiationOptions: Option[ForCommandInstantiationOptions]
)(implicit expressionValueEvaluator: ValueEvaluator[ExpressionElement]): ErrorOr[EvaluatedValue[WomSingleFile]] =
EvaluatedValue(WomSingleFile(ioFunctionSet.pathFunctions.stdout), Seq.empty).validNel
ErrorOr(EvaluatedValue(WomSingleFile(ioFunctionSet.pathFunctions.stdout), Seq.empty))

Check warning on line 54 in wdl/transforms/new-base/src/main/scala/wdl/transforms/base/linking/expression/values/EngineFunctionEvaluators.scala

View check run for this annotation

Codecov / codecov/patch

wdl/transforms/new-base/src/main/scala/wdl/transforms/base/linking/expression/values/EngineFunctionEvaluators.scala#L54

Added line #L54 was not covered by tests
}

implicit val stderrFunctionEvaluator: ValueEvaluator[StderrElement.type] = new ValueEvaluator[StderrElement.type] {
Expand All @@ -60,7 +60,7 @@
ioFunctionSet: IoFunctionSet,
forCommandInstantiationOptions: Option[ForCommandInstantiationOptions]
)(implicit expressionValueEvaluator: ValueEvaluator[ExpressionElement]): ErrorOr[EvaluatedValue[WomSingleFile]] =
EvaluatedValue(WomSingleFile(ioFunctionSet.pathFunctions.stderr), Seq.empty).validNel
ErrorOr(EvaluatedValue(WomSingleFile(ioFunctionSet.pathFunctions.stderr), Seq.empty))

Check warning on line 63 in wdl/transforms/new-base/src/main/scala/wdl/transforms/base/linking/expression/values/EngineFunctionEvaluators.scala

View check run for this annotation

Codecov / codecov/patch

wdl/transforms/new-base/src/main/scala/wdl/transforms/base/linking/expression/values/EngineFunctionEvaluators.scala#L63

Added line #L63 was not covered by tests
}

private val ReadWaitTimeout = 60.seconds
Expand Down
Loading