From dc163866399d9b6f135872bd2a18c5e7fce82b6d Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Tue, 6 Apr 2021 15:45:21 +0300 Subject: [PATCH] Fix wal_accetor tests --- integration_tests/tests/test_wal_acceptor.rs | 12 +++++++----- vendor/postgres | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/integration_tests/tests/test_wal_acceptor.rs b/integration_tests/tests/test_wal_acceptor.rs index 7683768280..df0d55413d 100644 --- a/integration_tests/tests/test_wal_acceptor.rs +++ b/integration_tests/tests/test_wal_acceptor.rs @@ -130,8 +130,8 @@ fn test_acceptors_unavalability() { .unwrap(); storage_cplane.wal_acceptors[0].stop(); - let ap = Arc::new(storage_cplane); - start_acceptor(&ap, 0); + let cp = Arc::new(storage_cplane); + start_acceptor(&cp, 0); let now = SystemTime::now(); psql.execute("INSERT INTO t values (2, 'payload')", &[]) .unwrap(); @@ -139,8 +139,8 @@ fn test_acceptors_unavalability() { psql.execute("INSERT INTO t values (3, 'payload')", &[]) .unwrap(); - ap.wal_acceptors[1].stop(); - start_acceptor(&ap, 1); + cp.wal_acceptors[1].stop(); + start_acceptor(&cp, 1); psql.execute("INSERT INTO t values (4, 'payload')", &[]) .unwrap(); assert!(now.elapsed().unwrap().as_secs() > 2); @@ -200,7 +200,8 @@ fn test_race_conditions() { "postgres", "CREATE TABLE t(key int primary key, value text)", ); - let cp = Arc::new(storage_cplane); + let cplane = Arc::new(storage_cplane); + let cp = cplane.clone(); thread::spawn(move || { simulate_failures(&cp); }); @@ -217,4 +218,5 @@ fn test_race_conditions() { .get(0); println!("sum = {}", count); assert_eq!(count, 500500); + cplane.stop(); } diff --git a/vendor/postgres b/vendor/postgres index 90b47392c4..b1f5a5ec14 160000 --- a/vendor/postgres +++ b/vendor/postgres @@ -1 +1 @@ -Subproject commit 90b47392c48c0aaffcc197bce0a255b77a2c282e +Subproject commit b1f5a5ec145d5d9614eec4824074edae1162e5fa