Skip to content

Conversation

@LukasLendvorsky
Copy link

@LukasLendvorsky LukasLendvorsky commented Oct 29, 2025

Description
ShellDriver._check_prompt uses regexp that expects you get marker immediately followed by prompt, only separated by whitespace.
But sometimes, you can get some unrelated message on the shell console in between the marker and prompt, something like this:

root@user:~# echo 'SVVZ''SYBQPQ'
SVVZSYBQPQ
[   37.369462] systemd-journald[159]: Time jumped backwards, rotating.
root@user:~#

This is enough to break _check_prompt, it will timeout as the regexp never maches. This fixes the issue by waiting separately for the marker and prompt.

@LukasLendvorsky LukasLendvorsky force-pushed the fix_check_prompt_master branch from 516880a to 00e3cf4 Compare October 29, 2025 16:00
@jluebbe
Copy link
Member

jluebbe commented Oct 30, 2025

Nothing guarantees that the kernel log is on its own line. To really fix this, you need to disable console logging via dmesg (which the ShellDriver tries to do very early).

@LukasLendvorsky
Copy link
Author

I don't have any newline expectations in my regexp, it should still pass even if its not on its own line.
I found the code that is supposed to disable the logs and have to agree that it would be better solution. Unfortunately it doesn't work for me. The code looks like this:

if did_login and not did_silence_kernel:
                    # Silence the kernel and wait for another prompt
                    self.console.sendline("dmesg -n 1")|

But my device has auto-login on serial console, so did_login is false so it never disables the logs. I would then propose to set it everytime, regardless of did_login, WDYT?

@LukasLendvorsky
Copy link
Author

Closing this in favor of #1765, which should be better fix for the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants