Skip to content

FreeBSD /bin/sh test workaround, simple "call and response" test using bc(1)#20

Merged
takluyver merged 15 commits intomasterfrom
freebsd-sh-test-workaround
Apr 27, 2015
Merged

FreeBSD /bin/sh test workaround, simple "call and response" test using bc(1)#20
takluyver merged 15 commits intomasterfrom
freebsd-sh-test-workaround

Conversation

@jquast
Copy link
Copy Markdown
Contributor

@jquast jquast commented Apr 27, 2015

  • Workaround freebsd AT&T shell in test.
    • There is something I am not able to understand about /bin/sh on freebsd: This is actually some kind of "second output of input echo" that occurs only with the AT&T-compatible /bin/sh on FreeBSD, and intermittently (a modified version of the test runs forever on OSX and Linux). Full analysis in test failure on FreeBSD #12 (comment)
    • The workaround is to gather all output to a single string, instead of individual line-by-line reads.
  • Made only a slightly better "call and response/repl" test, but I ran into a lot of blockers.
    • It seems the non-gnu bc(1) (anything but Linux) somehow echos input to output, even when echo=False. I thoroughly tested the getecho/setecho/waitnoecho family of functions (and discovered PR bugfix: waitnoecho() refers to missing self.timeout #19 along the way). If I run "stty -echo" on bash, then bc, my input is most certainly not written to output.
    • My current theory is that there is a difference between executing bc(1) directly and setting terminal attributes rather than executing a shell, setting terminal attributes, then executing bc(1) from there. I just added a "note:" about not including an assertion for now.
  • remove unused _is_irix
  • skip waitnoecho tests on Solaris
  • I saw /bin/false return something other than 1. Once.. just check non-zero status instead. https://teamcity-master.pexpect.org/viewLog.html?tab=buildLog&logTab=tree&filter=debug&expand=all&buildId=6228#_focus=2040

jquast added 15 commits April 26, 2015 23:14
There is something I am not able to understand about /bin/sh
on freebsd: This is actually some kind of "second output of
input echo" that occurs only with the AT&T-compatible /bin/sh
on FreeBSD, and intermittently (a modified version of the test
runs forever on OSX and Linux).

Complete analysis is in issue #12,
#12 (comment)
- We cannot use any of the setecho/getecho family of
  functions on solaris, skip them on such platform.
- Do not unnecessary test the same in test_interactive_*
  family of tests, these are covered by test_echo.py
- When the EOFError is caught, any *further* reads will
  **block** forever on Solaris, whereas Linux, FreeBSD,
  and OSX would continue to raise EOFError.  No need to
  unnecessarily test such OS internal, remove such test.
As noted in in the methods for this, there are no workarounds
for Solaris, we need to be careful not to use such methods, as
they block forever, causing the test runner to freeze up.
I've only seen this happen once on Solaris, and I
admit that I don't really understand it!
@jquast jquast mentioned this pull request Apr 27, 2015
@jquast
Copy link
Copy Markdown
Contributor Author

jquast commented Apr 27, 2015

With these changes (to tests, only), I am confident in a ptyprocess v0.5, anyway. It will ensure "green" builds downstream for all OS's

(except for the remaining asyncio/EOF issue in pexpect, I hope to return to this specific issue after a short break)

@takluyver
Copy link
Copy Markdown
Member

All looking good to me. Thanks!

takluyver added a commit that referenced this pull request Apr 27, 2015
FreeBSD /bin/sh test workaround, simple "call and response" test using bc(1)
@takluyver takluyver merged commit 4058faa into master Apr 27, 2015
@takluyver takluyver deleted the freebsd-sh-test-workaround branch April 27, 2015 03:59
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