From 0ef8bb50e8b2c1dc6068d19dceed18b16f788293 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Fri, 21 Jul 2023 16:18:33 -0700 Subject: [PATCH] drop x at the end of most tests --- web3_proxy/tests/test_multiple_proxy.rs | 4 ++++ web3_proxy/tests/test_proxy.rs | 3 +++ web3_proxy/tests/test_single_proxy.rs | 3 ++- web3_proxy/tests/test_sum_credits_used.rs | 3 +++ web3_proxy/tests/test_users.rs | 6 ++++++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/web3_proxy/tests/test_multiple_proxy.rs b/web3_proxy/tests/test_multiple_proxy.rs index 93175bf4..6ad3f244 100644 --- a/web3_proxy/tests/test_multiple_proxy.rs +++ b/web3_proxy/tests/test_multiple_proxy.rs @@ -264,6 +264,10 @@ async fn test_multiple_proxies_stats_add_up() { // "user_get_influx_stats_detailed stats are: {:?}", // user_get_influx_stats_detailed // ); + + // drop x first to avoid spurious warnings about anvil/influx/mysql shutting down before the app + drop(x_0); + drop(x_1); } // Gotta compare stats with influx: diff --git a/web3_proxy/tests/test_proxy.rs b/web3_proxy/tests/test_proxy.rs index aede371c..a351af2e 100644 --- a/web3_proxy/tests/test_proxy.rs +++ b/web3_proxy/tests/test_proxy.rs @@ -20,6 +20,9 @@ async fn it_migrates_the_db() { // we call flush stats more to be sure it works than because we expect it to save any stats x.flush_stats().await.unwrap(); + + // drop x first to avoid spurious warnings about anvil/influx/mysql shutting down before the app + drop(x); } #[test_log::test(tokio::test)] diff --git a/web3_proxy/tests/test_single_proxy.rs b/web3_proxy/tests/test_single_proxy.rs index 6841fc3e..6092f0ac 100644 --- a/web3_proxy/tests/test_single_proxy.rs +++ b/web3_proxy/tests/test_single_proxy.rs @@ -232,7 +232,8 @@ async fn test_single_proxy_stats_add_up() { // user_get_influx_stats_detailed // ); - // drop x before the other things so that we don't get spurious errors + + // drop x first to avoid spurious warnings about anvil/influx/mysql shutting down before the app drop(x); } diff --git a/web3_proxy/tests/test_sum_credits_used.rs b/web3_proxy/tests/test_sum_credits_used.rs index 2b3ff8b0..0e60e5f7 100644 --- a/web3_proxy/tests/test_sum_credits_used.rs +++ b/web3_proxy/tests/test_sum_credits_used.rs @@ -215,4 +215,7 @@ async fn test_sum_credits_used() { assert_eq!(admin_balance.remaining(), 0.into(), "remaining"); // TODO: query "user 0" to get the public counts + + // drop x first to avoid spurious warnings about anvil/influx/mysql shutting down before the app + drop(x); } diff --git a/web3_proxy/tests/test_users.rs b/web3_proxy/tests/test_users.rs index 6f342e42..685e23e1 100644 --- a/web3_proxy/tests/test_users.rs +++ b/web3_proxy/tests/test_users.rs @@ -562,6 +562,9 @@ async fn test_referral_bonus_concurrent_referrer_only() { referrer_balance_pre + difference / Decimal::from(10), referrer_balance_post ); + + // drop x first to avoid spurious warnings about anvil/influx/mysql shutting down before the app + drop(x); } #[cfg_attr(not(feature = "tests-needing-docker"), ignore)] @@ -747,4 +750,7 @@ async fn test_referral_bonus_concurrent_referrer_and_user() { (referrer_balance_pre - user_difference + user_difference / Decimal::from(10)), referrer_balance_post ); + + // drop x first to avoid spurious warnings about anvil/influx/mysql shutting down before the app + drop(x); }