burke / zeus

Boot any rails app in under a second.
MIT License
3.33k stars 231 forks source link

Zeus test not working. #630

Closed jeremiahlukus closed 7 years ago

jeremiahlukus commented 7 years ago
Starting Zeus server v0.15.13
[ready] [crashed] [running] [connecting] [waiting]
boot
└── default_bundle
    ├── development_environment
    │   └── prerake
    └── test_environment
        └── test_helper

Available Commands: [waiting] [crashed] [ready]
zeus rake
zeus runner (alias: r)
zeus console (alias: c)
zeus server (alias: s)
zeus generate (alias: g)
zeus destroy (alias: d)
zeus dbconsole
zeus test (alias: rspec, testrb) [run to see backtrace]
slavenode.go:215: [test_helper] read unix ->: EOF

cat ZEUS.LOG

2017/04/21` 23:42:49.102156 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:142] test_helper/(no PID) entering state SUnbooted
2017/04/21 23:42:49.102164 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:142] default_bundle/(no PID) entering state SUnbooted
2017/04/21 23:42:49.102183 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:142] prerake/(no PID) entering state SUnbooted
2017/04/21 23:42:49.102194 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:142] development_environment/(no PID) entering state SUnbooted
2017/04/21 23:42:49.102200 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:142] test_environment/(no PID) entering state SUnbooted
2017/04/21 23:42:49.102225 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:142] boot/(no PID) entering state SUnbooted
2017/04/21 23:42:49.111239 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:380] boot/(no PID) running the root command now
2017/04/21 23:42:51.144047 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:128] boot/(57265) initialized slave boot with pid 57265 from parent 0
2017/04/21 23:42:51.144116 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:145] boot/(57265) entering state SBooting
2017/04/21 23:42:56.060945 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:220] boot/(57265) received action message
2017/04/21 23:42:56.060977 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:148] boot/(57265) entering state SReady
2017/04/21 23:42:56.060993 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:328] boot/(57265) now sending slave boot request for default_bundle
2017/04/21 23:42:56.063419 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:128] default_bundle/(57267) initialized slave default_bundle with pid 57267 from parent 57265
2017/04/21 23:42:56.063455 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:145] default_bundle/(57267) entering state SBooting
2017/04/21 23:42:59.183806 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:220] default_bundle/(57267) received action message
2017/04/21 23:42:59.183844 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:148] default_bundle/(57267) entering state SReady
2017/04/21 23:42:59.183867 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:328] default_bundle/(57267) now sending slave boot request for development_environment
2017/04/21 23:42:59.183903 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:328] default_bundle/(57267) now sending slave boot request for test_environment
2017/04/21 23:42:59.187891 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:128] development_environment/(57268) initialized slave development_environment with pid 57268 from parent 57267
2017/04/21 23:42:59.187953 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:145] development_environment/(57268) entering state SBooting
2017/04/21 23:42:59.188188 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:128] test_environment/(57269) initialized slave test_environment with pid 57269 from parent 57267
2017/04/21 23:42:59.198146 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:145] test_environment/(57269) entering state SBooting
2017/04/21 23:43:02.547168 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:220] test_environment/(57269) received action message
2017/04/21 23:43:02.547215 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:148] test_environment/(57269) entering state SReady
2017/04/21 23:43:02.547242 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:328] test_environment/(57269) now sending slave boot request for test_helper
2017/04/21 23:43:02.550481 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:128] test_helper/(57283) initialized slave test_helper with pid 57283 from parent 57269
2017/04/21 23:43:02.550540 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:145] test_helper/(57283) entering state SBooting
2017/04/21 23:43:02.638047 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:220] test_helper/(57283) received action message
2017/04/21 23:43:02.638098 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:151] test_helper/(no PID) entering state SCrashed
2017/04/21 23:43:02.721217 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:220] development_environment/(57268) received action message
2017/04/21 23:43:02.721251 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:148] development_environment/(57268) entering state SReady
2017/04/21 23:43:02.721267 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:328] development_environment/(57268) now sending slave boot request for prerake
2017/04/21 23:43:02.724149 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:128] prerake/(57296) initialized slave prerake with pid 57296 from parent 57268
2017/04/21 23:43:02.724183 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:145] prerake/(57296) entering state SBooting
2017/04/21 23:43:02.745248 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:220] prerake/(57296) received action message
2017/04/21 23:43:02.745285 [/Users/phil/Source/go/src/github.com/burke/zeus/go/processtree/slavenode.go:148] prerake/(57296) entering state SReady
ENV['RAILS_ENV'] ||= 'test'

is in my rails_helper.rb not my spec_helper I am not sure if this is the reason. Zeus server works fine really fast! I really want the tests though ha

jeremiahlukus commented 7 years ago

the quickest and probably least invasive fix is to move

require 'rpsec/rails' above

require 'spec_helper' in the rails_helper.rb file

so that it looks like the following:

require 'rpsec/rails' require 'spec_helper'

http://stackoverflow.com/questions/26073898/rspec-3-1-with-zeus-should-i-require-rspec-rails-in-spec-helper

silverdr commented 4 years ago

In my case the very same issue was caused by pending migrations on the test env.

RAILS_ENV=test rails db:migrate

did the trick. Of course dev env must be up to date too.