From 3f051bc1f951bac0c1b82def3f3cc40785581841 Mon Sep 17 00:00:00 2001 From: qima Date: Sun, 15 Dec 2024 22:53:00 +0800 Subject: [PATCH] chore: extra sleep --- .github/workflows/merge.yml | 2 +- autonomi/src/client/mod.rs | 6 ++++++ autonomi/tests/put.rs | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 60faed6af6..f0b2b4c9d2 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -578,7 +578,7 @@ jobs: - name: Stop the local network and upload logs if: always() - uses: maidsafe/ant-local-testnet-action@main + uses: maidsafe/ant-local-testnet-action@feat-addrs-logs with: action: stop log_file_prefix: safe_test_logs_e2e diff --git a/autonomi/src/client/mod.rs b/autonomi/src/client/mod.rs index fae0a87ba8..64d1cc15e2 100644 --- a/autonomi/src/client/mod.rs +++ b/autonomi/src/client/mod.rs @@ -120,6 +120,12 @@ impl Client { receiver.await.expect("sender should not close")?; debug!("Client is connected to the network"); + // With the switch to the new bootstrap cache scheme, + // Seems the too many `initial dial`s could result in failure, + // if startup quoting/upload tasks got started up immediatly. + // Hence, put in a forced duration to allow `initial network discovery` to be completed. + tokio::time::sleep(std::time::Duration::from_secs(10)); + Ok(Self { network, client_event_sender: Arc::new(None), diff --git a/autonomi/tests/put.rs b/autonomi/tests/put.rs index f5d411e691..b8286c2ae6 100644 --- a/autonomi/tests/put.rs +++ b/autonomi/tests/put.rs @@ -18,6 +18,9 @@ async fn put() -> Result<()> { let _log_appender_guard = LogBuilder::init_single_threaded_tokio_test("put", false); let client = Client::connect(&peers_from_env()?).await?; + + // sleep(Duration::from_secs(10)).await; + let wallet = get_funded_wallet(); let data = gen_random_data(1024 * 1024 * 10); @@ -25,6 +28,8 @@ async fn put() -> Result<()> { sleep(Duration::from_secs(10)).await; + // sleep(Duration::from_secs(10)).await; + let data_fetched = client.data_get_public(addr).await?; assert_eq!(data, data_fetched, "data fetched should match data put");