{"action":"created","issue":{"url":"https://api.github.com/repos/d11wtq/dockerpty-restored-2/issues/100","labels_url":"https://api.github.com/repos/d11wtq/dockerpty-restored-2/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/d11wtq/dockerpty-restored-2/issues/100/comments","events_url":"https://api.github.com/repos/d11wtq/dockerpty-restored-2/issues/100/events","html_url":"https://github.com/d11wtq/dockerpty-restored-2/issues/100","id":107841570,"number":100,"title":"fix pumps when used with slow streams","user":{"login":"d11wtq","id":37948,"avatar_url":"https://avatars.githubusercontent.com/u/37948?v=3","gravatar_id":"","url":"https://api.github.com/users/d11wtq","html_url":"https://github.com/d11wtq","followers_url":"https://api.github.com/users/d11wtq/followers","following_url":"https://api.github.com/users/d11wtq/following{/other_user}","gists_url":"https://api.github.com/users/d11wtq/gists{/gist_id}","starred_url":"https://api.github.com/users/d11wtq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d11wtq/subscriptions","organizations_url":"https://api.github.com/users/d11wtq/orgs","repos_url":"https://api.github.com/users/d11wtq/repos","events_url":"https://api.github.com/users/d11wtq/events{/privacy}","received_events_url":"https://api.github.com/users/d11wtq/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-09-23T03:07:14Z","updated_at":"2015-09-23T03:07:44Z","closed_at":"2015-09-23T03:07:17Z","body":"#6 Issue by __dnephin__, created on: 2014-08-13T16:03:59Z\n\nThis is a very rough solution for #4.\r\n\r\nObviously `time.sleep()` is not good, but I wanted to post this to see how we can improve it.\r\n\r\nI added a bunch of debugging to `dockerpty` and ran it on jenkins. I noticed that `select()` would only return the streams that were ready (in some cases just stdin), so when flush of stdin returned None, it would exit without every printing anything (because stdout was never flushed)\r\n\r\nI think the change to the select/flush block is correct, but I'm not sure of the correct way to deal with waiting for the streams to be available.\r\n\r\nWithout the sleep this does nothing because the streams just aren't available yet and it just exits the while loop immediately."},"comment":{"url":"https://api.github.com/repos/d11wtq/dockerpty-restored-2/issues/comments/142478357","html_url":"https://github.com/d11wtq/dockerpty-restored-2/issues/100#issuecomment-142478357","issue_url":"https://api.github.com/repos/d11wtq/dockerpty-restored-2/issues/100","id":142478357,"user":{"login":"d11wtq","id":37948,"avatar_url":"https://avatars.githubusercontent.com/u/37948?v=3","gravatar_id":"","url":"https://api.github.com/users/d11wtq","html_url":"https://github.com/d11wtq","followers_url":"https://api.github.com/users/d11wtq/followers","following_url":"https://api.github.com/users/d11wtq/following{/other_user}","gists_url":"https://api.github.com/users/d11wtq/gists{/gist_id}","starred_url":"https://api.github.com/users/d11wtq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d11wtq/subscriptions","organizations_url":"https://api.github.com/users/d11wtq/orgs","repos_url":"https://api.github.com/users/d11wtq/repos","events_url":"https://api.github.com/users/d11wtq/events{/privacy}","received_events_url":"https://api.github.com/users/d11wtq/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T03:07:44Z","updated_at":"2015-09-23T03:07:44Z","body":"Comment by __d11wtq__, created on: 2014-08-15T00:59:21Z\n\nDoes Jenkins actually run builds inside a PTY, or is it just running a script naively? This is a gap in the test coverage in dockerpty, so I think I need to write features for \"Attaching to a docker container from a non-interactive shell\", which would basically use `os.spawn()` (or a variant thereof) instead of `pty.fork()` in the step definitions. This seems logical, since stdin wouldn't be open in such an environment (unless the script was being executed as part of a pipe).\r\n\r\nIt would definitely be good to prove the bug with a failing test case and work to fix that! I'll come back to this later, as I've left my pair stranded at work!"}}