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

[ftr] remove digdug, use chromedriver directly #11558

Merged
merged 3 commits into from
May 4, 2017

Conversation

spalger
Copy link
Contributor

@spalger spalger commented May 2, 2017

why?

  • digdug is meant to be used by intern, and expects a certain lifecycle that the FTR has tried and continuously fails to mimic
  • rather than continue trying to force digdug into the stack, just spawn chromedriver ourselves. We know how to handle it
  • cleans up verbose remote logging while we're in there, since selenium-standalone-server was previously doing the verbose logging, and was provided by digdug
  • deprecate servers.webdriver ftr config
  • added chromedriver.url ftr config
  • if url at chromedriver.url points to a server that responds to pings, use it as the chromedriver instance, enables running chrome in a VM or container
  • if pings to chromedriver.url fail a local chromedriver is started

@spalger spalger requested a review from rhoboat May 2, 2017 01:30
@spalger spalger force-pushed the debug/ftr-start-remote-failures branch 3 times, most recently from 6da72e8 to 22f0c8d Compare May 3, 2017 02:00
why?
 - digdug is meant to be used by intern, and expects a certain lifecycle that the FTR has tried and continuously fails to mimic
 - rather than continue trying to force digdug into the stack, just spawn chromedriver ourselves. We know how to handle it
 - cleans up verbose remote logging while we're in there, since selenium-standalone-server went with digdug, which was previously doing the verbose logging
 - deprecate config.servers.webdriver
 - add config.chromedriver.url
 - if url at config.chromedriver.url points to a server that responds to http requests use it as the chromedriver instance, enables running chrome in a VM or container
 - if pings to config.chromedriver.url fail a local chromedriver is started
@spalger spalger force-pushed the debug/ftr-start-remote-failures branch from 22f0c8d to 3143aa9 Compare May 3, 2017 02:06
@spalger spalger changed the title [ftr] temporarily force log level verbose during startup [ftr] remove digdug, use chromedriver directly May 3, 2017
@rhoboat
Copy link

rhoboat commented May 4, 2017

Confirmed that tests run fine, and that Chrome and chromedriver are killed after failed test, passing tests, and interrupt (Ctrl+C).

@rhoboat
Copy link

rhoboat commented May 4, 2017

When there is no kibana/es server running, the tests start and fail, but chromedriver does not get killed.

@rhoboat
Copy link

rhoboat commented May 4, 2017

jenkins, test it

result: tests all passed but publishing artifacts to s3 failed.

Copy link

@rhoboat rhoboat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small spelling error and, if it's possible, killing chromedriver when there's a client request error, like:

     │        Client request error: connect ECONNREFUSED 127.0.0.1:5620
     │         Error: connect ECONNREFUSED 127.0.0.1:5620
     │         at Object.exports._errnoException (util.js:1022:11)
     │         at exports._exceptionWithHostPort (util.js:1045:20)
     │         at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)

Besides, LGTM!

I also confirmed that a separate instance of chromedriver running will get picked up and used by the ftr.


proc.on('exit', (code) => {
if (!api.isStopped() || code > 0) {
api.emit('error', new Error(`Chromedriver exitted with code ${code}`));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exited

'clean:screenshots',
'functionalTestRunner'
]);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

this._url = url;
this._state = undefined;
this._callCustomStart = () => start(this);
this._callCustomStop = () => stop(this);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two lines, do you need to pass this as an argument? i don't think it's used.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, i see it now. this is passed in as api in the factory methods.

},

async stop() {
await fcb(cb => treeKill(proc.pid, undefined, cb));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ this is awesome. i didn't know about fromCallback in bluebird. but, why are you passing undefined as the 2nd arg? does it do SIGKILL by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it does SIGINT by default... I'm just passing undefined so it will use it's default.

* Create an instance of the ChromedriverApi for a url.
*
* @param {ToolingLog} log
* @param {Lifecycle} lifecycle
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope

@spalger spalger force-pushed the debug/ftr-start-remote-failures branch from 50bff62 to 8db3d65 Compare May 4, 2017 18:03
@spalger spalger merged commit f76bef4 into elastic:master May 4, 2017
@spalger spalger added the v5.5.0 label May 4, 2017
spalger added a commit that referenced this pull request May 4, 2017
* [ftr] remove digdug, use chromedriver directly

why?
 - digdug is meant to be used by intern, and expects a certain lifecycle that the FTR has tried and continuously fails to mimic
 - rather than continue trying to force digdug into the stack, just spawn chromedriver ourselves. We know how to handle it
 - cleans up verbose remote logging while we're in there, since selenium-standalone-server went with digdug, which was previously doing the verbose logging
 - deprecate config.servers.webdriver
 - add config.chromedriver.url
 - if url at config.chromedriver.url points to a server that responds to http requests use it as the chromedriver instance, enables running chrome in a VM or container
 - if pings to config.chromedriver.url fail a local chromedriver is started

* address review requests

(cherry picked from commit f76bef4)
@spalger
Copy link
Contributor Author

spalger commented May 4, 2017

5.5/5.x: 0ee55f7

@spalger spalger deleted the debug/ftr-start-remote-failures branch October 18, 2019 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants