Demonstrates a pecuilar problem whereby it appears a shell session occasionally does not produce an EOF on the pty slave after exit. I'm not sure this is an issue with the implementation of PTY or an OS X issue. It does not appear to be a shell issue per-se as I can produce the failure with bash, zsh, ksh, csh, and tcsh.
Example failures:
thinkerbot:~/Documents/Gems/shell_test> ruby --version
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.4.0]
thinkerbot:~/Documents/Gems/shell_test> time ruby pty_fail.rb 10000 /bin/bash
pty_fail.rb:19:in `block (2 levels) in <main>': timeout waiting for slave EOF (i:425 pid:13569) (RuntimeError)
"exit 8\r\n$ exit 8\r\nexit\r\n"