-
Notifications
You must be signed in to change notification settings - Fork 115
Replace Connection with gen_statem #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@whatyouhide make sure that you run the integration tests in |
|
Looks fantastic. But note CI fails. :) And yeah, maybe it is simpler to not update |
|
@josevalim fixed the bug, now |
| Logger.error( | ||
| fn -> | ||
| [ | ||
| inspect(mod), | ||
| " (", | ||
| inspect(self()), | ||
| ") failed to connect: " | Exception.format_banner(:error, err, []) | ||
| ] | ||
| end, | ||
| crash_reason: {err, []} | ||
| ) |
There was a problem hiding this comment.
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 -> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 π΅βπ«
|
@whatyouhide can you check CI? is_exception is not available, you will have to pattern match. :) |
|
Oooph yeah, I stopped checking because it was giving trouble with Erlang/Elixir versions yesterday, and I thought it was still that. Fixed now. |
|
π π π π β€οΈ |
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.