[tbot] Negative timeout error with acquire_linux()
Harald Seiler
hws at denx.de
Thu Nov 29 13:27:28 UTC 2018
Hi Niel,
On Thu, 2018-11-29 at 10:52 +0100, Niel Fourie wrote:
> Hi Harald,
>
> Just FYI, with tbot release 0.6.3, on Fedora Core 28 with Python 3.6.6,
> when using acquire_linux(), on waiting for the login prompt, I get this
> exception quite a lot:
>
>
> │ Traceback (most recent call last):
> │ File "/home/lusus/workspace/git/tbot/tbot/main.py", line 220, in main
> │ testcases[tc]()
> │ File "/home/lusus/workspace/git/tbot/tbot/__init__.py", line 55,
> in wrapped
> │ result = tc(*args, **kwargs)
> │ File "/home/lusus/workspace/tbot-tutorial/tc.py", line 20, in
> my_testcase
> │ lnx = cx.enter_context(tbot.acquire_linux(b))
> │ File "/home/lusus/workspace/git/tbot/tbot/selectable.py", line
> 191, in acquire_linux
> │ return LinuxMachine(b)
> │ File "/home/lusus/workspace/git/tbot/tbot/machine/board/linux.py",
> line 230, in __init__
> │ log = self.boot_to_shell(channel.SkipStream(ev,
> len(last_command) + 1))
> │ File "/home/lusus/workspace/git/tbot/tbot/machine/board/linux.py",
> line 95, in boot_to_shell
> │ chan.read_until_prompt("TBOTLOGIN", timeout=0.2, must_end=False)
> │ File
> "/home/lusus/workspace/git/tbot/tbot/machine/channel/channel.py", line
> 332, in read_until_prompt
> │ new = self.recv(timeout=timeout_remaining)
> │ File
> "/home/lusus/workspace/git/tbot/tbot/machine/channel/subprocess.py",
> line 73, in recv
> │ r, _, _ = select.select([self.pty_master], [], [], timeout)
> │ ValueError: timeout must be non-negative
>
> If I make the timeout=1 in tbot/tbot/machine/board/linux.py line 95,
> then the issue disappears. As discussed on chat, adding an extra check
> may work around it. My setup seems to exhibit quite a few quirks. Sorry!
Fixed in 5fa305618de86f27d2e24ee2ff943edac0c8ee53[1].
[1]: https://github.com/Rahix/tbot/commit/5fa305618de86f27d2e24ee2ff943edac0c8ee53
> Best regards,
> Niel Fourie
>
--
Harald
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-62 Fax: +49-8142-66989-80 Email: hws at denx.de
More information about the tbot
mailing list