You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by wu...@apache.org on 2023/02/24 08:25:13 UTC

[ambari-metrics] branch master updated: AMBARI-25865: Fix an unit test failure on ambari-metrics-host-monitoring (#103)

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

wuzhiguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ambari-metrics.git


The following commit(s) were added to refs/heads/master by this push:
     new c015cf9  AMBARI-25865: Fix an unit test failure on ambari-metrics-host-monitoring (#103)
c015cf9 is described below

commit c015cf9bbf524db65ccc31f7dde1ad536f453d93
Author: Kengo Seki <se...@apache.org>
AuthorDate: Fri Feb 24 17:25:07 2023 +0900

    AMBARI-25865: Fix an unit test failure on ambari-metrics-host-monitoring (#103)
---
 ambari-metrics-host-monitoring/pom.xml                      | 6 +-----
 ambari-metrics-host-monitoring/src/test/python/unitTests.py | 5 ++++-
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/ambari-metrics-host-monitoring/pom.xml b/ambari-metrics-host-monitoring/pom.xml
index be27cae..0b4f637 100644
--- a/ambari-metrics-host-monitoring/pom.xml
+++ b/ambari-metrics-host-monitoring/pom.xml
@@ -44,7 +44,7 @@
             <fileset>
               <directory>${project.basedir}/src/main/python/psutil/build/</directory>
               <includes>
-                <include>**/*</include>
+                <include>**</include>
               </includes>
               <followSymlinks>false</followSymlinks>
             </fileset>
@@ -188,10 +188,6 @@
                     <exec dir="${basedir}/src/main/python/psutil" executable="${executable.python}" failonerror="true">
                       <arg value="setup.py" />
                       <arg value="build" />
-                      <arg value="--build-temp" />
-                      <arg value="${basedir}/target/psutil_build_temp" />
-                      <arg value="--build-base" />
-                      <arg value="${basedir}/target/psutil_build" />
                     </exec>
                   </target>
                 </configuration>
diff --git a/ambari-metrics-host-monitoring/src/test/python/unitTests.py b/ambari-metrics-host-monitoring/src/test/python/unitTests.py
index 7445546..f4aa845 100644
--- a/ambari-metrics-host-monitoring/src/test/python/unitTests.py
+++ b/ambari-metrics-host-monitoring/src/test/python/unitTests.py
@@ -100,8 +100,11 @@ def main():
     test_mask = TEST_MASK
 
   tests = get_test_files(pwd, mask=test_mask, recursive=True)
-  shuffle(tests)
   modules = [os.path.basename(s)[:-3] for s in tests]
+  # Workaround for AMBARI-25865. This avoids loading psutil too early.
+  i = modules.index("TestHostInfo")
+  if -1 < i:
+    modules.append(modules.pop(i))
   suites = [unittest.defaultTestLoader.loadTestsFromName(name) for name in
     modules]
   testSuite = unittest.TestSuite(suites)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ambari.apache.org
For additional commands, e-mail: commits-help@ambari.apache.org