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

twister: Improve handling of errors while flashing device #33214

Merged
merged 1 commit into from Mar 16, 2021

Conversation

PerMac
Copy link
Member

@PerMac PerMac commented Mar 10, 2021

The patch improves handling runners errors from flashing. It
add thread termination in case of process returning non 0 exit
code. Before, even though the error was returned,
a thread was not terminated and test ended
only after timeout termination. The patch also adds information about
the failure reason to the reports

Signed-off-by: Maciej Perkowski Maciej.Perkowski@nordicsemi.no

@PerMac PerMac linked an issue Mar 11, 2021 that may be closed by this pull request
@@ -814,6 +814,8 @@ def handle(self):
self.instance.reason = "Device issue (Flash?)"
with open(d_log, "w") as dlog_fp:
dlog_fp.write(stderr.decode())
os.write(write_pipe, b'x') # halt the thread
out_state = "Flash error"
Copy link
Member

Choose a reason for hiding this comment

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

use flash_error

for c in self.instance.testcase.cases:
if c not in harness.tests:
harness.tests[c] = "BLOCK"

self.instance.reason = "Timeout"
self.instance.reason = out_state
Copy link
Member

Choose a reason for hiding this comment

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

here, translate the state to a readable reason string.

The patch improves handling runners errors from flashing. It
add thread termination in case of process returning non 0 exit
code. Before, even though the error was returned,
a thread was not terminated and test ended
only after timeout termination. The patch also adds information about
the failure reason to the reports

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
@PerMac PerMac force-pushed the fix/runner_error_handeling branch from f3ee308 to 0e7dbd5 Compare March 12, 2021 10:38
@PerMac
Copy link
Member Author

PerMac commented Mar 12, 2021

@nashif requested changes applied.

@PerMac PerMac requested a review from nashif March 15, 2021 14:57
@nashif nashif merged commit f050a99 into zephyrproject-rtos:master Mar 16, 2021
@PerMac PerMac deleted the fix/runner_error_handeling branch July 17, 2023 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

twister: Twister cannot properly handle runners errors (flashing)
3 participants