Skip to content

Commit 171f3e9

Browse files
authored
WX-757 Fix stdout, stderr in workflow body causing crashes (#7386)
1 parent cac2b6f commit 171f3e9

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version 1.0
2+
3+
workflow break_with_stderr {
4+
5+
output {
6+
File load_data_csv = select_first([stdout(), stderr()])
7+
}
8+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: stderr_stdout_workflow_body
2+
testFormat: workflowfailure
3+
4+
files {
5+
workflow: failures/stderr_stdout_workflow_body/stderr_stdout_workflow_body.wdl
6+
}
7+
8+
metadata {
9+
workflowName: break_with_stderr
10+
status: Failed
11+
"failures.0.message": "Workflow failed"
12+
"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"
13+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ object EngineFunctionEvaluators {
5151
ioFunctionSet: IoFunctionSet,
5252
forCommandInstantiationOptions: Option[ForCommandInstantiationOptions]
5353
)(implicit expressionValueEvaluator: ValueEvaluator[ExpressionElement]): ErrorOr[EvaluatedValue[WomSingleFile]] =
54-
EvaluatedValue(WomSingleFile(ioFunctionSet.pathFunctions.stdout), Seq.empty).validNel
54+
ErrorOr(EvaluatedValue(WomSingleFile(ioFunctionSet.pathFunctions.stdout), Seq.empty))
5555
}
5656

5757
implicit val stderrFunctionEvaluator: ValueEvaluator[StderrElement.type] = new ValueEvaluator[StderrElement.type] {
@@ -60,7 +60,7 @@ object EngineFunctionEvaluators {
6060
ioFunctionSet: IoFunctionSet,
6161
forCommandInstantiationOptions: Option[ForCommandInstantiationOptions]
6262
)(implicit expressionValueEvaluator: ValueEvaluator[ExpressionElement]): ErrorOr[EvaluatedValue[WomSingleFile]] =
63-
EvaluatedValue(WomSingleFile(ioFunctionSet.pathFunctions.stderr), Seq.empty).validNel
63+
ErrorOr(EvaluatedValue(WomSingleFile(ioFunctionSet.pathFunctions.stderr), Seq.empty))
6464
}
6565

6666
private val ReadWaitTimeout = 60.seconds

0 commit comments

Comments
 (0)