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

Restart doesn't wait long enough if the host can't be found #63

Open
wwahammy opened this issue Jul 29, 2016 · 2 comments
Open

Restart doesn't wait long enough if the host can't be found #63

wwahammy opened this issue Jul 29, 2016 · 2 comments
Labels

Comments

@wwahammy
Copy link
Contributor

At https://github.com/qca/boardfarm/blob/master/devices/debian.py#L80 the ping tests are supposed to be spread at least 1 second apart. This doesn't actually work if you're trying to ping a hostname which can't be found because it's rebooting. In that case, there's no delay of 1 second and the host isn't able to reboot fast enough and the reset fails.

I've done a work around for prpl by adding an extra time.sleep(1) in the except statement but that sort of changes the semantics. In some cases with the fix you'll wait 2 seconds (if the ping never returns) or 1 second if the host name can't be found. Nonetheless, it does wait long enough for a reboot.

@mattsm
Copy link
Contributor

mattsm commented Jul 29, 2016

Two options:

  1. Do DNS lookup first, and wait for it... but since it's weird you are probably getting IP via some local broadcast that makes me think 2 is better
  2. pexpect.spawn("sleep 1 & ping ...; fg") or pexect.spawn("ping foo || sleep 1") - always wait one second, or wait a second if it fails...

Waiting 2 seconds is not the end of the world honestly.

@mattsm
Copy link
Contributor

mattsm commented Oct 14, 2016

Eric, did you find a workable solution?

@mattsm mattsm added the bug label Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants