Skip to content

Commit 9d8b009

Browse files
committed
Wait for thread termination in cancel_query test
1 parent 47f9a66 commit 9d8b009

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ fn test_cancel_query() {
641641
let conn = or_panic!(Connection::connect("postgres://postgres@localhost", SslMode::None));
642642
let cancel_data = conn.cancel_data();
643643

644-
let _t = thread::spawn(move || {
644+
let t = thread::spawn(move || {
645645
thread::sleep(Duration::from_millis(500));
646646
assert!(postgres::cancel_query("postgres://postgres@localhost", SslMode::None,
647647
&cancel_data).is_ok());
@@ -652,6 +652,8 @@ fn test_cancel_query() {
652652
Err(res) => panic!("Unexpected result {:?}", res),
653653
_ => panic!("Unexpected result"),
654654
}
655+
656+
t.join().unwrap();
655657
}
656658

657659
#[test]

0 commit comments

Comments
 (0)