{"action":"created","issue":{"url":"https://api.github.com/repos/Khan/KaTeX/issues/264","labels_url":"https://api.github.com/repos/Khan/KaTeX/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/Khan/KaTeX/issues/264/comments","events_url":"https://api.github.com/repos/Khan/KaTeX/issues/264/events","html_url":"https://github.com/Khan/KaTeX/pull/264","id":90176563,"number":264,"title":"Selenium images","user":{"login":"gagern","id":190759,"avatar_url":"https://avatars.githubusercontent.com/u/190759?v=3","gravatar_id":"","url":"https://api.github.com/users/gagern","html_url":"https://github.com/gagern","followers_url":"https://api.github.com/users/gagern/followers","following_url":"https://api.github.com/users/gagern/following{/other_user}","gists_url":"https://api.github.com/users/gagern/gists{/gist_id}","starred_url":"https://api.github.com/users/gagern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gagern/subscriptions","organizations_url":"https://api.github.com/users/gagern/orgs","repos_url":"https://api.github.com/users/gagern/repos","events_url":"https://api.github.com/users/gagern/events{/privacy}","received_events_url":"https://api.github.com/users/gagern/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2015-06-22T18:40:33Z","updated_at":"2015-07-08T14:04:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Khan/KaTeX/pulls/264","html_url":"https://github.com/Khan/KaTeX/pull/264","diff_url":"https://github.com/Khan/KaTeX/pull/264.diff","patch_url":"https://github.com/Khan/KaTeX/pull/264.patch"},"body":"In #263 I suggested (among other things) the use of standard selenium docker images instead of the custom docker image currently used by KaTeX. Reasons for this approach include avoiding the build time associated with the custom docker, using the perfect reproducibility of a fixed image, and the chance of easily obtaining images from Chrome as well. My suggestion received at least one positive response, so here I'm following this up with an actual pull request.\r\n\r\nExcept for `Lap`, all the other examples can be reproduced *exactly* by the new setup, which is more than I had dared to hope for. I tried to use this opportunity to work around the strange non-determinism of the `Lap` example as well. Assuming that it had to be some kind of race condition, I added this code:\r\n\r\n```diff\r\n     driver.get(url);\r\n+    if (key === \"Lap\") {\r\n+        driver.controlFlow().timeout(200, \"Deal with strange non-determinism\");\r\n+    }\r\n     driver.takeScreenshot().then(function haveScreenshot(img) {\r\n```\r\n\r\nUnfortunately, I still got different results on different machines. Very strange!\r\n\r\nNote that I replaced the Python script controlling the Selenium driver from inside the docker with a JavaScript doing so from the outside. The language switch in my opinion makes things more consistent, since the rest of the project is in JavaScript. It also means we can use `npm` to drag in the required dependency, and won't need any install instructions for the Python bindings.\r\n\r\nAs far as I understand it, the same repository and tag may identify different images over time. Although I don't expect this to happen if the tag is a specific version number, you never know. Just in case, here are the image ids for the images I'm using for this:\r\n\r\n    selenium/standalone-chrome:2.46.0   7aa0b75ca012\r\n    selenium/standalone-firefox:2.46.0  7f9e0fc69088\r\n"},"comment":{"url":"https://api.github.com/repos/Khan/KaTeX/issues/comments/119590496","html_url":"https://github.com/Khan/KaTeX/pull/264#issuecomment-119590496","issue_url":"https://api.github.com/repos/Khan/KaTeX/issues/264","id":119590496,"user":{"login":"kevinb7","id":1044413,"avatar_url":"https://avatars.githubusercontent.com/u/1044413?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinb7","html_url":"https://github.com/kevinb7","followers_url":"https://api.github.com/users/kevinb7/followers","following_url":"https://api.github.com/users/kevinb7/following{/other_user}","gists_url":"https://api.github.com/users/kevinb7/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinb7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinb7/subscriptions","organizations_url":"https://api.github.com/users/kevinb7/orgs","repos_url":"https://api.github.com/users/kevinb7/repos","events_url":"https://api.github.com/users/kevinb7/events{/privacy}","received_events_url":"https://api.github.com/users/kevinb7/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T14:04:13Z","updated_at":"2015-07-08T14:04:13Z","body":"It's weird because when I specified a specific port to open with `dockerode` I was able to get selenium to connect in the callback to `docker.start` without having to wait.\r\n\r\n> But right now I'm worried about cleanup after an interrupt, so I won't take that route just now.\r\n\r\nGood point.  We'd have to add some extra signal catching code.  Right now if you do a ctrl-c it exits `screenshotter.js` and `screenshot.sh` continues to run and stop the container?"}}