:econnrefused error on mix test

I have a phoenix project with name bpm_server, in an umbrella, but it’s the only project there.
mix test runs ok in this project with MIX_ENV=test
I created another umbrella wherein I have several projects, I created a phoenix project with the same name, bpm_server again, within this umbrella. With MIX_ENV=dev mix phoenix.server runs ok. There is a db connection. But when I switch to MIX_ENV=test and run mix test I get errors:

13:29:54.328 [error] GenServer #PID<0.201.0> terminating
** (DBConnection.ConnectionError) tcp connect: connection refused - :econnrefused
(db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
** (Mix) The database for BpmServer.Repo couldn’t be created: an exception was raised:
** (DBConnection.ConnectionError) tcp connect: connection refused - :econnrefused
(db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5

If I create another new phoenix project within this umbrella with another name, and the same database config in test.exs, mix test runs ok again. I’m puzzled. Could this be a bug in phoenix or am I missing something? The only solution I see at the moment is using another projectname for bpm_server in my new umbrella.

Found the cause. In the umbrella where mix test for the bpm_server project failed I kept a backup of that project also. I had renamed that project folder to bpm_server_backup, but the modulenames still had BpmServer in them of course. Unexpectedly for me mix test in the bpm_server folder is bothered by the files the bpm_server_backup folder. So both folders resided under apps, after removing bpm_server_backup + contents my problem was gone.