This is an automated email from the ASF dual-hosted git repository.

coolfrog pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-horaedb.git


The following commit(s) were added to refs/heads/main by this push:
     new 87de3c38 fix: random failure of test_collect_system_stats (#1459)
87de3c38 is described below

commit 87de3c38309a72625c3b32c527b73c40ded80543
Author: WEI Xikai <[email protected]>
AuthorDate: Wed Jan 24 09:35:35 2024 +0800

    fix: random failure of test_collect_system_stats (#1459)
    
    ## Rationale
    The unit test `test_collect_system_stats` often fails when running on
    the github ci server.
    
    ## Detailed Changes
    Remove the check for cpu usages.
    
    ## Test Plan
    Should pass the CI.
---
 src/components/system_stats/src/lib.rs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/components/system_stats/src/lib.rs 
b/src/components/system_stats/src/lib.rs
index 00892efd..c06c2317 100644
--- a/src/components/system_stats/src/lib.rs
+++ b/src/components/system_stats/src/lib.rs
@@ -147,10 +147,11 @@ mod tests {
                 .collect_and_report(Duration::from_millis(200))
                 .await;
             check_system_stats(&new_stats);
-            all_cpu_usages.push(new_stats.cpu_usage);
+            all_cpu_usages.push(new_stats);
         }
 
-        // Ensure the stats will be updated for every collection.
-        assert!(all_cpu_usages.into_iter().any(|v| v != stats.cpu_usage));
+        assert!(all_cpu_usages
+            .into_iter()
+            .all(|v| v.num_cpus == stats.num_cpus && v.total_memory == 
stats.total_memory));
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to