Skip to content

Commit e471fef

Browse files
committed
Test for pool connection's force close.
1 parent 090a459 commit e471fef

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/pool_test.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,5 +267,21 @@ void main() {
267267
await expectLater(() => rs, throwsA(isA<PgException>()));
268268
});
269269
});
270+
271+
withPostgresServer('inner connection close', (server) {
272+
test('connection from inside withConnection', () async {
273+
final pool = await openPool(server);
274+
final rs = pool.withConnection((c) async {
275+
await Future.wait([
276+
Future.delayed(
277+
Duration(milliseconds: 200),
278+
() => c.close(force: true),
279+
),
280+
runLongQuery(c),
281+
]);
282+
});
283+
await expectLater(() => rs, throwsA(isA<PgException>()));
284+
});
285+
});
270286
});
271287
}

0 commit comments

Comments
 (0)