npgsql
npgsql copied to clipboard
NpgsqlConnection.ConnectionString parsing fails for IPv6 hosts
This was broken by changes introduced with the multiple hosts feature.
The ConnectionString_Host tests are failing on my local machine (and the test case for 127.0.0.1,127.0.0.1:5432,::1,[::1],[::1]:5432,localhost,localhost:5432
even hangs...).
@Brar @vonzshik are you not seeing this on your machines? Interesting that this isn't happening on CI either...
No, it worked after the fixes from @vonzshik
@roji everything's green on my end...
I've temporarily disabled the test in #3824, will revisit this later to investigate what's special about my setup...
Couldn't reproduce any issues with this test, reenabling in #4703.
Ran into this again and figured it out... My postgresql.conf didn't have listen_addresses
set, which means it defaults to localhost
; apparently in some way that means that PG doesn't listen on IPv6, so test cases for e.g. ::1
failed with "connection refused". For multi-host cases, this failure caused the open attempt to hang indefinitely on the non-IPv6 option in the connection string (waiting for someone to close a connection).
Will look into making this test check pure parsing and not having it depend on environment configuration etc.