Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@whatyouhide
Copy link
Contributor

Just started on this but all tests pass πŸ™ƒ I also tried this branch out in ecto_sql and all tests pass there too. I'll see if I can try it in Postgrex maybe.

@josevalim
Copy link
Member

@whatyouhide make sure that you run the integration tests in ecto_sql. :)

@josevalim
Copy link
Member

Looks fantastic. But note CI fails. :) And yeah, maybe it is simpler to not update connection indeed, so we keep it "stable".

@whatyouhide
Copy link
Contributor Author

@josevalim fixed the bug, now mix test.all passes here. Will try the integration tests in ecto_sql.

Comment on lines +108 to +118
Logger.error(
fn ->
[
inspect(mod),
" (",
inspect(self()),
") failed to connect: " | Exception.format_banner(:error, err, [])
]
end,
crash_reason: {err, []}
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josevalim I had to add this here too. From testing with ecto_sql, it turns out that raiseing here doesn't log anything for gen_statem, but it did log for Connection. I’m confused, but I also suck at OTP logging, so I’m not surprised πŸ™ƒ

If you have better ideas, I’m all ears. πŸ™ƒ

end

assert capture_log(fn ->
capture_log(fn ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should keep the assertion and update it just in case? Especially as you said they report errors different?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josevalim yeah, I had to add a manual log again. I’m not sure why gen_statem is not logging anything when stopping with reason other than normal/shutdown πŸ˜΅β€πŸ’«

@josevalim josevalim closed this Feb 14, 2023
@josevalim josevalim reopened this Feb 14, 2023
@josevalim
Copy link
Member

@whatyouhide can you check CI? is_exception is not available, you will have to pattern match. :)

@whatyouhide
Copy link
Contributor Author

Oooph yeah, I stopped checking because it was giving trouble with Erlang/Elixir versions yesterday, and I thought it was still that. Fixed now.

@josevalim josevalim merged commit 4565ded into elixir-ecto:master Feb 14, 2023
@josevalim
Copy link
Member

πŸ’š πŸ’™ πŸ’œ πŸ’› ❀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants