neo4jrb / neo4j-core

A simple unified API that can access both the server and embedded Neo4j database. Used by the neo4j gem
MIT License
99 stars 80 forks source link

Check Neo4j server responsiveness for CI #302

Closed jgaskins closed 7 years ago

jgaskins commented 7 years ago

This PR is intended to make CI builds faster without jumping the gun on the server by looping until the server responds. This will also guard against the possibility of the Neo4j server taking > 2 minutes to accept connections.

It is throttled to check only once per second so it doesn't waste CPU resources spinning up processes that it could be spending on spinning up the Neo4j server.

Pings: @cheerfulstoic @subvertallchris

jgaskins commented 7 years ago

To test this, I ran neo4j stop on my own machine, ran that while loop (with open http://localhost:7474/), and then ran neo4j start. When the web page opened for the Neo4j browser, it was indeed accepting connections.

jgaskins commented 7 years ago

Ugh, except I forgot that stuff that works on zsh doesn't always work with bash. I'll try something else. :-)

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 73.68% when pulling 696b1772ae52b509fe74e346a0b4945da0fcf07e on jgaskins:patch-1 into 44f0754a500fa0b86ed5fa27a18e00fb4d88ba0a on neo4jrb:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 73.68% when pulling 696b1772ae52b509fe74e346a0b4945da0fcf07e on jgaskins:patch-1 into 44f0754a500fa0b86ed5fa27a18e00fb4d88ba0a on neo4jrb:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 73.68% when pulling 696b1772ae52b509fe74e346a0b4945da0fcf07e on jgaskins:patch-1 into 44f0754a500fa0b86ed5fa27a18e00fb4d88ba0a on neo4jrb:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 73.68% when pulling 696b1772ae52b509fe74e346a0b4945da0fcf07e on jgaskins:patch-1 into 44f0754a500fa0b86ed5fa27a18e00fb4d88ba0a on neo4jrb:master.

cheerfulstoic commented 7 years ago

It seems to have run fine (and faster!) on Travis (latest master for comparison). The jRuby builds aren't faster, but this should definitely help.

You said you were trying something else, but would you say that this is OK to go based on Travis?

jgaskins commented 7 years ago

Ah, yep, sorry, I forgot to update that I fixed it. It was just that while one-liners are slightly different between bash and zsh. 👍

jgaskins commented 7 years ago

Oh, actually, it looks like most of the JRuby builds are indeed faster. One definitely wasn't, but the others did see a 60- to 90-second boost. Sweeet! :-D

cheerfulstoic commented 7 years ago

Excellent, thanks so much for this!