Fix the case when step generates an error which is passed to a step state, but test runner exits first #121
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The test logs are:
time="2022-08-07T18:51:48Z" level=debug msg="monitor: active" file="test_runner.go:447"
time="2022-08-07T18:51:48Z" level=debug msg="monitor: starting at step [#0 Step1]" file="test_runner.go:449"
time="2022-08-07T18:51:48Z" level=debug msg="monitor pass 1: current step [#0 Step1]" file="test_runner.go:462"
time="2022-08-07T18:51:48Z" level=debug msg="monitor pass 1: [#0 Step1]: [Target{ID: "TExtra"} 0 init false ]" file="test_runner.go:466"
time="2022-08-07T18:51:48Z" level=debug msg="monitor pass 1: [#0 Step1]: not all targets injected yet ([Target{ID: "TExtra"} 0 init false ])" file="test_runner.go:471"
time="2022-08-07T18:51:48Z" level=debug msg="[Target{ID: "TExtra"} 0 init false ]: target handler active" file="test_runner.go:326" target=TExtra
time="2022-08-07T18:51:48Z" level=debug msg="[Target{ID: "TExtra"} 0 begin false ]: injecting into [#0 Step1]" file="test_runner.go:365" target=TExtra
time="2022-08-07T18:51:48Z" level=info msg="Obtained '{Target{ID: "TExtra"} }' for target 'TExtra'" file="step_runner.go:329" step_index=0 step_label=Step1 target=TExtra
time="2022-08-07T18:51:48Z" level=info msg="Obtained '{Target{ID: "TExtra2"} }' for target 'TExtra2'" file="step_runner.go:329" step_index=0 step_label=Step1 target=TExtra
time="2022-08-07T18:51:48Z" level=error msg="err: test step Step1 returned unexpected result for TExtra2" file="step_runner.go:436" step_index=0 step_label=Step1 target=TExtra
time="2022-08-07T18:51:48Z" level=debug msg="Reading loop finished" file="step_runner.go:143" step_index=0 step_label=Step1 target=TExtra
time="2022-08-07T18:51:48Z" level=debug msg="Got target result: ''" file="test_runner.go:382" target=TExtra
time="2022-08-07T18:51:48Z" level=debug msg="[Target{ID: "TExtra"} 0 end true ]: target handler finished" file="test_runner.go:322" target=TExtra
time="2022-08-07T18:51:48Z" level=debug msg="monitor pass 2: current step [#0 Step1]" file="test_runner.go:462"
time="2022-08-07T18:51:48Z" level=debug msg="monitor pass 2: [#0 Step1]: [Target{ID: "TExtra"} 0 end true ]" file="test_runner.go:466"
time="2022-08-07T18:51:48Z" level=debug msg="monitor pass 2: [#0 Step1]: no more targets, closing input channel" file="test_runner.go:485"
time="2022-08-07T18:51:48Z" level=debug msg="monitor pass 0: [Target{ID: "TExtra"} 0 end true ]" file="test_runner.go:509"
time="2022-08-07T18:51:48Z" level=debug msg="monitor: finished, " file="test_runner.go:525"
time="2022-08-07T18:51:48Z" level=debug msg="waiting for step runners to finish" file="test_runner.go:283"
time="2022-08-07T18:51:48Z" level=debug msg="cancel target handlers" file="test_runner.go:203"
time="2022-08-07T18:51:48Z" level=debug msg="leaving, err test step Step1 returned unexpected result for TExtra2, target states:" file="test_runner.go:214"
time="2022-08-07T18:51:48Z" level=debug msg=" 0 target: '[Target{ID: "TExtra"} 0 end true ]' step err: '', resume ok: 'false'" file="test_runner.go:236"
time="2022-08-07T18:51:48Z" level=debug msg="- 0 in flight, ok to resume? false" file="test_runner.go:238"
time="2022-08-07T18:51:48Z" level=debug msg="step states:" file="test_runner.go:239"
time="2022-08-07T18:51:48Z" level=debug msg=" 0 [#0 Step1] true %!t() " file="test_runner.go:241"
--- FAIL: TestTestRunnerSuite (2.43s)
--- FAIL: TestTestRunnerSuite/TestStepYieldsResultForNonexistentTarget (0.01s)
test_runner_test.go:373:
Error Trace: /go/src/github.com/linuxboot/contest/pkg/runner/test_runner_test.go:373
Error: Not equal:
expected: "\n{[1 1 SimpleTest 0 Step1][(*Target)(nil) TestError &"\"test step Step1 returned unexpected result for TExtra2\""]}\n"
actual : "\n\n"
time="2022-08-07T18:51:48Z" level=debug msg="TestStep finished '', rs: ''" file="step_runner.go:417" step_index=0 step_label=Step1 target=TExtra
time="2022-08-07T18:51:48Z" level=debug msg="output channel closed" file="step_runner.go:397" step_index=0 step_label=Step1 target=TExtra
time="2022-08-07T18:51:48Z" level=debug msg="Running loop finished" file="step_runner.go:137" step_index=0 step_label=Step1 target=TExtra
time="2022-08-07T18:51:48Z" level=debug msg="StepRunner finished" file="step_runner.go:129" step_index=0 step_label=Step1 target=TExtra