"rake test" error after running tests

I’m getting this with Rails 5 + Ruby 2.3.1, even after rebuilding cache. The tests run and minitest-ci report is generated, but it always ends with this error.

((bundle exec "rake test")) returned exit code 1

This means the build is shown as red even if all tests pass.