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

Bump to Intern 3.0.0 #25

Closed

Conversation

benlangfeld
Copy link

Demonstrates that this new version hangs when executed against PhantomJS/Selenium.

The output I see is:

> [email protected] test /Users/ben/code/intern-examples/phantomjs-example
> intern-runner config=tests/intern

Listening on 0.0.0.0:9000

I do not see any log output in Selenium or ChromeDriver logs. AFAICT, Intern is not even attempting a connection.

Demonstrates that this new version hangs when executed against PhantomJS/Selenium
@vladikoff
Copy link
Member

@csnover does I3 support PhantomJS or was that dropped?

@benlangfeld
Copy link
Author

It's still in the documentation and pretends like it'll work, so I suspect removing it was not the intention.

@jason0x43
Copy link
Member

The issue may be that the intern config doesn't specify functionalSuites. I've noticed that Intern 3 seems to hang when functionalSuites is undefined, but I haven't looked into the reason why yet.

@benlangfeld
Copy link
Author

That does indeed appear to be the issue in this case, @jason0x43. Unfortunately it is not the case in my upgrade of Intern for Candy Chat, meaning I need to find another minimal reproduction.

@benlangfeld
Copy link
Author

When run against Selenium Standalone in a VirtualBox VM:

> [email protected] test /Users/ben/code/intern-examples/phantomjs-example
> intern-runner config=tests/intern

Listening on 0.0.0.0:9000
Tunnel started
‣ Created session phantomjs on any platform (a4e110f1-9f8d-4314-ab0a-91ba20dcf6ee)
11:33:54.807 INFO - Executing: [new session: Capabilities [{idle-timeout=60, browserName=phantomjs, name=tests/intern}]])
11:33:54.820 INFO - Creating a new session for Capabilities [{idle-timeout=60, browserName=phantomjs, name=tests/intern}]
11:33:54.834 INFO - executable: /usr/bin/phantomjs
11:33:54.834 INFO - port: 14733
11:33:54.835 INFO - arguments: [--webdriver=14733, --webdriver-logfile=/phantomjsdriver.log]
11:33:54.835 INFO - environment: {}
PhantomJS is launching GhostDriver...
[INFO  - 2015-08-31T11:33:55.639Z] GhostDriver - Main - running on port 14733
[INFO  - 2015-08-31T11:33:55.927Z] Session [29e56a30-4fd4-11e5-9658-9f7233793035] - CONSTRUCTOR - Desired Capabilities: {"idle-timeout":60,"browserName":"phantomjs","name":"tests/intern"}
[INFO  - 2015-08-31T11:33:55.927Z] Session [29e56a30-4fd4-11e5-9658-9f7233793035] - CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.0","driverName":"ghostdriver","driverVersion":"1.0.3","platform":"linux-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO  - 2015-08-31T11:33:55.928Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 29e56a30-4fd4-11e5-9658-9f7233793035
11:33:55.976 INFO - Done: [new session: Capabilities [{idle-timeout=60, browserName=phantomjs, name=tests/intern}]]
11:33:55.990 INFO - Executing: [get: about:blank])
11:33:56.005 INFO - Done: [get: about:blank]
11:33:56.013 INFO - Executing: org.openqa.selenium.remote.server.handler.UploadFile@627739ae)
11:33:56.016 INFO - Done: org.openqa.selenium.remote.server.handler.UploadFile@627739ae
11:33:56.027 INFO - Executing: [execute async script: arguments[0](true);, []])
11:33:56.032 INFO - Executing: [take screenshot])
11:33:56.040 INFO - Executing: [doubleclick: no args])
11:33:56.046 INFO - Executing: [Long press: null])
11:33:56.047 INFO - Done: [execute async script: arguments[0](true);, []]
11:33:56.056 INFO - Executing: [get window size])
11:33:56.110 INFO - Done: [take screenshot]
11:33:56.126 INFO - Done: [doubleclick: no args]
11:33:56.127 WARN - Exception thrown
java.lang.UnsupportedOperationException: Underlying driver does not implement advanced user interactions yet.
    at org.openqa.selenium.support.events.EventFiringWebDriver.getTouch(EventFiringWebDriver.java:312)
    at org.openqa.selenium.remote.server.handler.interactions.touch.LongPressOnElement.call(LongPressOnElement.java:41)
    at org.openqa.selenium.remote.server.handler.interactions.touch.LongPressOnElement.call(LongPressOnElement.java:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
11:33:56.128 WARN - Exception: Underlying driver does not implement advanced user interactions yet.
11:33:56.140 INFO - Done: [get window size]
11:33:56.147 INFO - Executing: [set window size])
11:33:56.150 INFO - Done: [set window size]
11:33:56.154 INFO - Executing: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Ctitle%3Ea%3C%2Ftitle%3E])
11:33:56.167 INFO - Done: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Ctitle%3Ea%3C%2Ftitle%3E]
11:33:56.173 INFO - Executing: [get title])
11:33:56.177 INFO - Done: [get title]
11:33:56.181 INFO - Executing: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cstyle%3E%23a%7Bwidth%3A8px%3Bheight%3A8px%3B-ms-transform%3Ascale(0.5)%3B-moz-transform%3Ascale(0.5)%3B-webkit-transform%3Ascale(0.5)%3Btransform%3Ascale(0.5)%3B%7D%3C%2Fstyle%3E%3Cdiv%20id%3D%22a%22%3E%3C%2Fdiv%3E])
11:33:56.196 INFO - Done: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cstyle%3E%23a%7Bwidth%3A8px%3Bheight%3A8px%3B-ms-transform%3Ascale(0.5)%3B-moz-transform%3Ascale(0.5)%3B-webkit-transform%3Ascale(0.5)%3Btransform%3Ascale(0.5)%3B%7D%3C%2Fstyle%3E%3Cdiv%20id%3D%22a%22%3E%3C%2Fdiv%3E]
11:33:56.202 INFO - Executing: [execute script: return (function () {
                        var bbox = document.getElementById('a').getBoundingClientRect();
                        return bbox.right - bbox.left === 4;
                    }).apply(this, arguments);, []])
11:33:56.212 INFO - Done: [execute script: return (function () {
                        var bbox = document.getElementById('a').getBoundingClientRect();
                        return bbox.right - bbox.left === 4;
                    }).apply(this, arguments);, []]
11:33:56.215 INFO - Executing: [get: about:blank])
11:33:56.231 INFO - Done: [get: about:blank]
11:33:56.242 INFO - Executing: [fetching available log types])
11:33:56.244 INFO - Executing: [find element: By.tagName: html])
11:33:56.246 INFO - Executing: [find element: By.tagName: html])
[ERROR - 2015-08-31T11:33:56.249Z] RouterReqHand - _handle - Thrown => {
  "message": "Request => {\"headers\":{\"Accept-Encoding\":\"gzip,deflate\",\"Cache-Control\":\"no-cache\",\"Connection\":\"Keep-Alive\",\"Host\":\"localhost:14733\",\"User-Agent\":\"Apache-HttpClient/4.4.1 (Java/1.7.0_79)\"},\"httpVersion\":\"1.1\",\"method\":\"GET\",\"url\":\"/log/types\",\"urlParsed\":{\"anchor\":\"\",\"query\":\"\",\"file\":\"types\",\"directory\":\"/log/\",\"path\":\"/log/types\",\"relative\":\"/log/types\",\"port\":\"\",\"host\":\"\",\"password\":\"\",\"user\":\"\",\"userInfo\":\"\",\"authority\":\"\",\"protocol\":\"\",\"source\":\"/log/types\",\"queryKey\":{},\"chunks\":[\"log\",\"types\"]},\"urlOriginal\":\"/session/29e56a30-4fd4-11e5-9658-9f7233793035/log/types\"}",
  "name": "Invalid Command Method",
  "line": 183,
  "sourceId": 140343577530432,
  "sourceURL": ":/ghostdriver/request_handlers/session_request_handler.js",
  "stack": "Invalid Command Method: Request => {\"headers\":{\"Accept-Encoding\":\"gzip,deflate\",\"Cache-Control\":\"no-cache\",\"Connection\":\"Keep-Alive\",\"Host\":\"localhost:14733\",\"User-Agent\":\"Apache-HttpClient/4.4.1 (Java/1.7.0_79)\"},\"httpVersion\":\"1.1\",\"method\":\"GET\",\"url\":\"/log/types\",\"urlParsed\":{\"anchor\":\"\",\"query\":\"\",\"file\":\"types\",\"directory\":\"/log/\",\"path\":\"/log/types\",\"relative\":\"/log/types\",\"port\":\"\",\"host\":\"\",\"password\":\"\",\"user\":\"\",\"userInfo\":\"\",\"authority\":\"\",\"protocol\":\"\",\"source\":\"/log/types\",\"queryKey\":{},\"chunks\":[\"log\",\"types\"]},\"urlOriginal\":\"/session/29e56a30-4fd4-11e5-9658-9f7233793035/log/types\"}\n    at :/ghostdriver/request_handlers/session_request_handler.js:183\n    at :/ghostdriver/request_handlers/request_handler.js:61\n    at :/ghostdriver/request_handlers/router_request_handler.js:82",
  "stackArray": [
    {
      "sourceURL": ":/ghostdriver/request_handlers/session_request_handler.js",
      "line": 183
    },
    {
      "sourceURL": ":/ghostdriver/request_handlers/request_handler.js",
      "line": 61
    },
    {
      "sourceURL": ":/ghostdriver/request_handlers/router_request_handler.js",
      "line": 82
    }
  ]
}
11:33:56.258 WARN - Exception thrown
org.openqa.selenium.UnsupportedCommandException: Invalid Command Method - Request => {"headers":{"Accept-Encoding":"gzip,deflate","Cache-Control":"no-cache","Connection":"Keep-Alive","Host":"localhost:14733","User-Agent":"Apache-HttpClient/4.4.1 (Java/1.7.0_79)"},"httpVersion":"1.1","method":"GET","url":"/log/types","urlParsed":{"anchor":"","query":"","file":"types","directory":"/log/","path":"/log/types","relative":"/log/types","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/log/types","queryKey":{},"chunks":["log","types"]},"urlOriginal":"/session/29e56a30-4fd4-11e5-9658-9f7233793035/log/types"}
Command duration or timeout: 12 milliseconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'vagrant-ubuntu-trusty-64', ip: '10.0.2.15', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-35-generic', java.version: '1.7.0_79'
Session ID: 29e56a30-4fd4-11e5-9658-9f7233793035
Driver info: org.openqa.selenium.phantomjs.PhantomJSDriver
Capabilities [{platform=LINUX, acceptSslCerts=false, javascriptEnabled=true, browserName=phantomjs, rotatable=false, driverVersion=1.0.3, locationContextEnabled=false, version=1.9.0, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=false, browserConnectionEnabled=false, proxy={proxyType=direct}, nativeEvents=true, webStorageEnabled=false, driverName=ghostdriver, applicationCacheEnabled=false, takesScreenshot=true}]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:618)
    at org.openqa.selenium.remote.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:33)
    at org.openqa.selenium.remote.RemoteLogs.getAvailableLogTypes(RemoteLogs.java:103)
    at org.openqa.selenium.remote.server.handler.GetAvailableLogTypesHandler.call(GetAvailableLogTypesHandler.java:37)
    at org.openqa.selenium.remote.server.handler.GetAvailableLogTypesHandler.call(GetAvailableLogTypesHandler.java:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
11:33:56.259 WARN - Exception: Invalid Command Method - Request => {"headers":{"Accept-Encoding":"gzip,deflate","Cache-Control":"no-cache","Connection":"Keep-Alive","Host":"localhost:14733","User-Agent":"Apache-HttpClient/4.4.1 (Java/1.7.0_79)"},"httpVersion":"1.1","method":"GET","url":"/log/types","urlParsed":{"anchor":"","query":"","file":"types","directory":"/log/","path":"/log/types","relative":"/log/types","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/log/types","queryKey":{},"chunks":["log","types"]},"urlOriginal":"/session/29e56a30-4fd4-11e5-9658-9f7233793035/log/types"}
Command duration or timeout: 12 milliseconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'vagrant-ubuntu-trusty-64', ip: '10.0.2.15', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-35-generic', java.version: '1.7.0_79'
Session ID: 29e56a30-4fd4-11e5-9658-9f7233793035
Driver info: org.openqa.selenium.phantomjs.PhantomJSDriver
Capabilities [{platform=LINUX, acceptSslCerts=false, javascriptEnabled=true, browserName=phantomjs, rotatable=false, driverVersion=1.0.3, locationContextEnabled=false, version=1.9.0, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=false, browserConnectionEnabled=false, proxy={proxyType=direct}, nativeEvents=true, webStorageEnabled=false, driverName=ghostdriver, applicationCacheEnabled=false, takesScreenshot=true}]
11:33:56.324 INFO - Done: [find element: By.tagName: html]
11:33:56.383 INFO - Executing: [get element attribute: 0 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> tag name: html], nonexisting])
11:33:56.383 INFO - Done: [find element: By.tagName: html]
11:33:56.390 INFO - Executing: [tag name: 0 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> tag name: html]])
11:33:56.405 INFO - Done: [get element attribute: 0 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> tag name: html], nonexisting]
11:33:56.415 INFO - Done: [tag name: 0 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> tag name: html]]
11:33:56.420 INFO - Executing: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cdiv%20id%3D%22a%22%3E%3C%2Fdiv%3E])
11:33:56.435 INFO - Done: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cdiv%20id%3D%22a%22%3E%3C%2Fdiv%3E]
11:33:56.440 INFO - Executing: [execute script: return document.getElementById("a");, []])
11:33:56.446 INFO - Done: [execute script: return document.getElementById("a");, []]
11:33:56.451 INFO - Executing: [tag name: 1 [org.openqa.selenium.remote.RemoteWebElement@ad36c10a -> unknown locator]])
11:33:56.454 INFO - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://localhost:14733: The target server failed to respond
11:33:56.454 INFO - Retrying request to {}->http://localhost:14733
11:33:56.459 INFO - Done: [tag name: 1 [org.openqa.selenium.remote.RemoteWebElement@ad36c10a -> unknown locator]]
11:33:56.463 INFO - Executing: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cdiv%20id%3D%22a%22%20style%3D%22opacity%3A%20.1%3B%22%3Ea%3C%2Fdiv%3E])
11:33:56.477 INFO - Done: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cdiv%20id%3D%22a%22%20style%3D%22opacity%3A%20.1%3B%22%3Ea%3C%2Fdiv%3E]
11:33:56.481 INFO - Executing: [execute script: var o = document.getElementById("a").style.opacity; return o && o.charAt(0) === "0";, []])
11:33:56.490 INFO - Done: [execute script: var o = document.getElementById("a").style.opacity; return o && o.charAt(0) === "0";, []]
11:33:56.495 INFO - Executing: [execute script: document.getElementById("a").style.opacity = "0";, []])
11:33:56.499 INFO - Done: [execute script: document.getElementById("a").style.opacity = "0";, []]
11:33:56.503 INFO - Executing: [find element: By.id: a])
11:33:56.511 INFO - Done: [find element: By.id: a]
11:33:56.515 INFO - Executing: [is displayed: 2 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> id: a]])
11:33:56.527 INFO - Done: [is displayed: 2 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> id: a]]
11:33:56.531 INFO - Executing: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cdiv%20id%3D%22a%22%20style%3D%22left%3A%200%3B%20position%3A%20absolute%3B%20top%3A%20-1000px%3B%22%3Ea%3C%2Fdiv%3E])
11:33:56.549 INFO - Done: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cdiv%20id%3D%22a%22%20style%3D%22left%3A%200%3B%20position%3A%20absolute%3B%20top%3A%20-1000px%3B%22%3Ea%3C%2Fdiv%3E]
11:33:56.555 INFO - Executing: [find element: By.id: a])
11:33:56.564 INFO - Done: [find element: By.id: a]
11:33:56.567 INFO - Executing: [is displayed: 3 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> id: a]])
11:33:56.577 INFO - Done: [is displayed: 3 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> id: a]]
11:33:56.582 INFO - Executing: [execute script: return (function (element) {
                    var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
                    var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
                    do {
                        if (window.getComputedStyle(element, null).opacity === '0') {
                            return false;
                        }

                        var bbox = element.getBoundingClientRect();
                        if (bbox.right + scrollX <= 0 || bbox.bottom + scrollY <= 0) {
                            return false;
                        }
                    }
                    while ((element = element.parentNode) && element.nodeType === 1);
                    return true;
                }).apply(this, arguments);, [[[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> id: a]]])
11:33:56.587 INFO - Done: [execute script: return (function (element) {
                    var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
                    var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
                    do {
                        if (window.getComputedStyle(element, null).opacity === '0') {
                            return false;
                        }

                        var bbox = element.getBoundingClientRect();
                        if (bbox.right + scrollX <= 0 || bbox.bottom + scrollY <= 0) {
                            return false;
                        }
                    }
                    while ((element = element.parentNode) && element.nodeType === 1);
                    return true;
                }).apply(this, arguments);, [[[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> id: a]]]
11:33:56.592 INFO - Executing: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cform%20method%3D%22get%22%20action%3D%22about%3Ablank%22%3E%3Cinput%20id%3D%22a%22%20type%3D%22submit%22%20name%3D%22a%22%20value%3D%22a%22%3E%3C%2Fform%3E])
11:33:56.606 INFO - Done: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cform%20method%3D%22get%22%20action%3D%22about%3Ablank%22%3E%3Cinput%20id%3D%22a%22%20type%3D%22submit%22%20name%3D%22a%22%20value%3D%22a%22%3E%3C%2Fform%3E]
11:33:56.611 INFO - Executing: [find element: By.id: a])
11:33:58.626 INFO - Done: [find element: By.id: a]
11:33:58.630 INFO - Executing: [submit: 4 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> id: a]])
11:33:58.653 INFO - Done: [submit: 4 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> id: a]]
11:33:58.656 INFO - Executing: [get current url])
11:33:58.661 INFO - Done: [get current url]
11:33:58.665 INFO - Executing: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cdiv%20id%3D%22a%22%20style%3D%22margin%3A%203000px%3B%22%3E%3C%2Fdiv%3E])
11:33:58.681 INFO - Done: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cdiv%20id%3D%22a%22%20style%3D%22margin%3A%203000px%3B%22%3E%3C%2Fdiv%3E]
11:33:58.687 INFO - Executing: [find element: By.id: a])
11:33:58.696 INFO - Done: [find element: By.id: a]
11:33:58.701 INFO - Executing: [get location: 5 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> id: a]])
11:33:58.706 INFO - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://localhost:14733: The target server failed to respond
11:33:58.706 INFO - Retrying request to {}->http://localhost:14733
11:33:58.720 INFO - Done: [get location: 5 [[PhantomJSDriver: phantomjs on LINUX (29e56a30-4fd4-11e5-9658-9f7233793035)] -> id: a]]
11:33:58.728 INFO - Executing: [get: about:blank?1])
11:33:58.742 INFO - Done: [get: about:blank?1]
11:33:58.747 INFO - Executing: [refresh])
11:33:58.768 INFO - Done: [refresh]
11:33:58.778 INFO - Executing: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cscript%3Ecounter%20%3D%200%3B%20var%20d%20%3D%20document%3B%20d.onclick%20%3D%20d.onmousedown%20%3D%20d.onmouseup%20%3D%20function%20()%20%7B%20counter%2B%2B%3B%20%7D%3B%3C%2Fscript%3E])
11:33:58.793 INFO - Done: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cscript%3Ecounter%20%3D%200%3B%20var%20d%20%3D%20document%3B%20d.onclick%20%3D%20d.onmousedown%20%3D%20d.onmouseup%20%3D%20function%20()%20%7B%20counter%2B%2B%3B%20%7D%3B%3C%2Fscript%3E]
11:33:58.797 INFO - Executing: [find element: By.tagName: html])
11:33:58.806 INFO - Done: [find element: By.tagName: html]
11:33:58.810 INFO - Executing: [mousemove: 6 false])
11:33:58.832 INFO - Done: [mousemove: 6 false]
11:33:58.937 INFO - Executing: [doubleclick: no args])
11:33:58.943 INFO - Done: [doubleclick: no args]
11:33:58.947 INFO - Executing: [execute script: return counter;, []])
11:33:58.952 INFO - Done: [execute script: return counter;, []]
11:33:58.956 INFO - Executing: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cstyle%3E%23a%7Bwidth%3A8px%3Bheight%3A8px%3B-ms-transform%3Ascale(0.5)%3B-moz-transform%3Ascale(0.5)%3B-webkit-transform%3Ascale(0.5)%3Btransform%3Ascale(0.5)%3B%7D%3C%2Fstyle%3E%3Cdiv%20id%3D%22a%22%3E%3C%2Fdiv%3E])
11:33:58.971 INFO - Done: [get: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Cstyle%3E%23a%7Bwidth%3A8px%3Bheight%3A8px%3B-ms-transform%3Ascale(0.5)%3B-moz-transform%3Ascale(0.5)%3B-webkit-transform%3Ascale(0.5)%3Btransform%3Ascale(0.5)%3B%7D%3C%2Fstyle%3E%3Cdiv%20id%3D%22a%22%3E%3C%2Fdiv%3E]
11:33:58.976 INFO - Executing: [execute script: return document.getElementById("a");, []])
11:33:58.983 INFO - Done: [execute script: return document.getElementById("a");, []]
11:33:58.990 INFO - Executing: [get element size: 7 [org.openqa.selenium.remote.RemoteWebElement@ad37bd06 -> unknown locator]])
11:33:58.999 INFO - Done: [get element size: 7 [org.openqa.selenium.remote.RemoteWebElement@ad37bd06 -> unknown locator]]
11:33:59.002 INFO - Executing: [get: about:blank])
11:33:59.016 INFO - Done: [get: about:blank]
11:33:59.026 INFO - Executing: [execute script: return (function getCoverageData(coverageVariable) {
        var coverageData = (function () { return this; })()[coverageVariable];
        return coverageData && JSON.stringify(coverageData);
    }).apply(this, arguments);, [__internCoverage]])
11:33:59.027 INFO - Executing: [get current url])
11:33:59.033 INFO - Done: [execute script: return (function getCoverageData(coverageVariable) {
        var coverageData = (function () { return this; })()[coverageVariable];
        return coverageData && JSON.stringify(coverageData);
    }).apply(this, arguments);, [__internCoverage]]
11:33:59.035 INFO - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://localhost:14733: The target server failed to respond
11:33:59.035 INFO - Retrying request to {}->http://localhost:14733
11:33:59.039 INFO - Executing: [get: http://localhost:9000/__intern/client.html?config=tests%2Fintern&basePath=%2F&initialBaseUrl=%2F&reporters=WebDriver&rootSuiteName=phantomjs%20on%20any%20platform%20-%20unit%20tests&sessionId=a4e110f1-9f8d-4314-ab0a-91ba20dcf6ee])
11:33:59.040 INFO - Done: [get current url]
11:33:59.056 INFO - Done: [get: http://localhost:9000/__intern/client.html?config=tests%2Fintern&basePath=%2F&initialBaseUrl=%2F&reporters=WebDriver&rootSuiteName=phantomjs%20on%20any%20platform%20-%20unit%20tests&sessionId=a4e110f1-9f8d-4314-ab0a-91ba20dcf6ee]

@benlangfeld
Copy link
Author

And now I'm seeing the same things on the master branch, which was not the case before. I'll take this elsewhere until I have something more conclusive. Apologies for the noise guys.

@benlangfeld
Copy link
Author

My trouble seems to be rooted in the fact that Intern 3 is not closing the TCP socket when a request for the test page completes:

* Connected to localhost (127.0.0.1) port 9000 (#0)
> GET /__intern/client.html?config=tests%2Fintern.local HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:9000
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/html
< Content-Length: 1462
< Date: Mon, 31 Aug 2015 17:42:19 GMT
< Connection: keep-alive
<
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Browser test runner</title>
        <script src="node_modules/dojo/loader.js"></script>
        <script>
            (function () {
                var internPath = location.pathname.replace(/\/+[^\/]*$/, '/');
                var initialBaseUrl = (function () {
                    var result = /[?&]initialBaseUrl=([^&]*)/.exec(location.search);
                    if (result) {
                        var baseUrl = decodeURIComponent(result[1]);

                        if (/^(?:\w+:)?\/\//.test(baseUrl)) {
                            throw new Error('Cross-origin loading of test modules is not allowed for security reasons');
                        }
                        return baseUrl;
                    }
                    else {
                        // For users running client.html directly, assume that the initial base URL is two levels up
                        // (the parent directory of node_modules/intern); this is most common.
                        // Users that need something special can provide a different `initialBaseUrl`.
                        return internPath.replace(/(?:\/+[^\/]*){2}\/?$/, '/');
                    }
                })();

                var internConfig = this.__internConfig = {
                    baseUrl: initialBaseUrl,
                    packages: [
                        { name: 'intern', location: internPath }
                    ],
                    map: {
                        intern: {
                            dojo: 'intern/node_modules/dojo',
                            chai: 'intern/node_modules/chai/chai',
                            diff: 'intern/node_modules/diff/diff'
                        },
                        '*': {
                            'intern/dojo': 'intern/node_modules/dojo'
                        }
                    }
                };

                require(internConfig, [ 'intern/client' ]);
            })();
        </script>
    </head>
    <body></body>
</html>
* Connection #0 to host localhost left intact

@jason0x43
Copy link
Member

Does it by chance help if you change that IIFE to a window.onload callback, like

window.onload = function () {
    var internPath = ...
    ...
    require(internConfig, [ 'intern/client' ]);
};

@benlangfeld
Copy link
Author

Where would I change that, @jason0x43? As far as I can guess, it won't make any difference. It's the HTTP connection, not the content of the response, which is the problem.

@jason0x43
Copy link
Member

You would change that in client.html (that's the content you're showing above). One issue that I've noticed that that the Selenium get request initiated by Intern to load the client.html page (used to run the unit tests) isn't completing as soon as the the static assets of client.html are loaded; instead, it stays open until sometime arbitrary time during the test process. Moving the test loading script on client.html into an onload callback lets Selenium recognize that the page has finished loading. It seemed like it could be related to your issue.

@benlangfeld
Copy link
Author

Unfortunately that didn't make any difference, @jason0x43. This works with Selenium + Chrome, but not Selenium + PhantomJS. Both work with Intern 2.2.2.

@csnover
Copy link
Member

csnover commented Sep 1, 2015

Please make sure you are using PhantomJS 2, PhantomJS 1 is not supported. Can you confirm there is an issue with PhantomJS 2 as well? This example seems to work without trouble against PhantomJS 2 using the latest Intern 3.0.x.

@benlangfeld
Copy link
Author

Apologies, @csnover, it seems this was PhantomJS 1.9.0, which is what ships with Ubuntu 14.04. I'll sort out getting that upgraded and confirm this is fixed.

@benlangfeld
Copy link
Author

It does indeed look like PhantomJS 2 fixes this particular issue, but I'm left with another regression which can be see at candy-chat/candy#417.

benlangfeld added a commit to candy-chat/candy that referenced this pull request Sep 3, 2015
Selenium w/ phantomjs can't cope with theintern/intern-examples#25 (comment). This docker image gives us headless Chrome, and switching to Docker gives us a more modern dev environment anyway.
@vladikoff vladikoff closed this Nov 5, 2015
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.

4 participants