File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -109,8 +109,21 @@ async def test_auth_reject(self):
109
109
with self .assertRaisesRegex (
110
110
asyncpg .InvalidAuthorizationSpecificationError ,
111
111
'pg_hba.conf rejects connection' ):
112
- await self .cluster .connect (
113
- user = 'reject_user' , database = 'postgres' , loop = self .loop )
112
+ for tried in range (3 ):
113
+ try :
114
+ await self .cluster .connect (
115
+ user = 'reject_user' , database = 'postgres' ,
116
+ loop = self .loop )
117
+ except asyncpg .ConnectionDoesNotExistError :
118
+ if _system == 'Windows' :
119
+ # On Windows the server sometimes just closes
120
+ # the connection sooner than we receive the
121
+ # actual error.
122
+ continue
123
+ else :
124
+ raise
125
+ else :
126
+ break
114
127
115
128
async def test_auth_password_cleartext (self ):
116
129
conn = await self .cluster .connect (
You can’t perform that action at this time.
0 commit comments