neo4jrb / activegraph

An active model wrapper for the Neo4j Graph Database for Ruby.
http://neo4jrb.io
MIT License
1.4k stars 276 forks source link

Fix wait_for_connection not waiting for connection #1540

Closed pudiva closed 5 years ago

pudiva commented 5 years ago

To reproduce the bug, before applying the patch, run the script bellow and note that the migration task will fail immediately, without retrying for 60 seconds.

rails new asd -O -m http://neo4jrb.io/neo4j/neo4j.rb
cd asd
patch -p0 <<EOF
--- config/application.rb       2019-03-18 17:06:49.587351900 +0000
+++ config/application.rb       2019-03-18 17:06:51.999351958 +0000
@@ -20,6 +20,7 @@

 module Asd
   class Application < Rails::Application
+    config.neo4j.wait_for_connection = true

     config.generators do |g|
       g.orm             :neo4j
EOF
time rake neo4j:migrate:all
pudiva commented 5 years ago

Some tests are failing ~on travis even though they pass on my machine~... looking into it.

codecov-io commented 5 years ago

Codecov Report

Merging #1540 into master will increase coverage by 0.07%. The diff coverage is 54.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1540      +/-   ##
==========================================
+ Coverage   93.24%   93.32%   +0.07%     
==========================================
  Files         104      104              
  Lines        4724     4808      +84     
==========================================
+ Hits         4405     4487      +82     
- Misses        319      321       +2
Impacted Files Coverage Δ
lib/neo4j/session_manager.rb 86.66% <54.54%> (-8.99%) :arrow_down:
lib/neo4j/migrations/schema_migration.rb 88.88% <0%> (-11.12%) :arrow_down:
lib/neo4j/active_base.rb 88.88% <0%> (-2.03%) :arrow_down:
lib/neo4j/active_node.rb 95% <0%> (-1.56%) :arrow_down:
...ib/rails/generators/neo4j/model/model_generator.rb 60% <0%> (-1.37%) :arrow_down:
lib/neo4j/shared/type_converters.rb 94.71% <0%> (-1.24%) :arrow_down:
lib/neo4j/active_node/has_n.rb 98.4% <0%> (-0.37%) :arrow_down:
...o4j/active_node/query/query_proxy_eager_loading.rb 100% <0%> (ø) :arrow_up:
...4j/active_node/has_n/association_cypher_methods.rb 100% <0%> (ø) :arrow_up:
lib/neo4j/class_arguments.rb 90% <0%> (ø) :arrow_up:
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5d02143...8ab64aa. Read the comment docs.