[tbot] Negative timeout error with acquire_linux()

Niel Fourie lusus at denx.de
Thu Nov 29 09:52:12 UTC 2018


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!

Best regards,
Niel Fourie

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-21 Fax: +49-8142-66989-80  Email: lusus at denx.de


More information about the tbot mailing list