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

trunner: add missing expect during flash procedure #386

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
4 changes: 4 additions & 0 deletions trunner/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ def run_tests(self, tests: Sequence[TestOptions]) -> Sequence[TestResult]:
# Ensure first test will start with reboot
last_test_failed = True

# Unload data before starting tests
if self.ctx.should_flash is not False and self.ctx.target.experimental is False:
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why it's disabled for experimental targets.

Can't we just always drain the buffer (without any IF?) - the same way as below:
self.target.dut.read(timeout=0.1)

Please note that this is still a race - new data might be produced between reading the buffer and issuing reboot before the first test.

self.target.dut.expect(r".+")

for test in tests:
# By default we don't want to reboot the entire device to speed up the test execution)
# if not explicitly required by the test.
Expand Down
Loading