Add tolerance to a flaky test
Resolves: rhbz#1913682
This commit is contained in:
parent
2a2016ea50
commit
ceacd511ed
25
python-psutil-add-tolerance.patch
Normal file
25
python-psutil-add-tolerance.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
From 4ffbcb458ff0b838f2bfe387b6305c4817e363ae Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
||||||
|
Date: Thu, 15 Apr 2021 17:07:38 +0200
|
||||||
|
Subject: [PATCH] Add tolerance to
|
||||||
|
test_linux.TestSystemVirtualMemory.test_total
|
||||||
|
|
||||||
|
We see this test as very flaky without tolerance in Fedora and CentOS
|
||||||
|
---
|
||||||
|
psutil/tests/test_linux.py | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py
|
||||||
|
index 0c6d498c8..f5243c2cd 100755
|
||||||
|
--- a/psutil/tests/test_linux.py
|
||||||
|
+++ b/psutil/tests/test_linux.py
|
||||||
|
@@ -243,7 +243,8 @@ def test_total(self):
|
||||||
|
# self.assertEqual(free_value, psutil_value)
|
||||||
|
vmstat_value = vmstat('total memory') * 1024
|
||||||
|
psutil_value = psutil.virtual_memory().total
|
||||||
|
- self.assertAlmostEqual(vmstat_value, psutil_value)
|
||||||
|
+ self.assertAlmostEqual(
|
||||||
|
+ vmstat_value, psutil_value, delta=TOLERANCE_SYS_MEM)
|
||||||
|
|
||||||
|
@retry_on_failure()
|
||||||
|
def test_used(self):
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Name: python-%{srcname}
|
Name: python-%{srcname}
|
||||||
Version: 5.8.0
|
Version: 5.8.0
|
||||||
Release: 6%{?dist}
|
Release: 7%{?dist}
|
||||||
Summary: %{sum}
|
Summary: %{sum}
|
||||||
|
|
||||||
License: BSD
|
License: BSD
|
||||||
@ -14,6 +14,9 @@ Source0: %{url}/archive/release-%{version}/%{srcname}-%{version}.tar.gz
|
|||||||
#
|
#
|
||||||
Patch0: python-psutil-skip-tests-in-mock.patch
|
Patch0: python-psutil-skip-tests-in-mock.patch
|
||||||
|
|
||||||
|
# Add tolerance to psutil.tests.test_linux.TestSystemVirtualMemory.test_total
|
||||||
|
Patch1: https://github.com/giampaolo/psutil/pull/1935.patch#/python-psutil-add-tolerance.patch
|
||||||
|
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: python%{python3_pkgversion}-devel
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
@ -72,6 +75,10 @@ make test CI_TESTING=1 PYTHON=%{__python3} PYTHONPATH=%{buildroot}/%{python3_sit
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Apr 15 2021 Miro Hrončok <mhroncok@redhat.com> - 5.8.0-7
|
||||||
|
- Add tolerance to a flaky test
|
||||||
|
Resolves: rhbz#1913682
|
||||||
|
|
||||||
* Tue Apr 06 2021 Miro Hrončok <mhroncok@redhat.com> - 5.8.0-6
|
* Tue Apr 06 2021 Miro Hrončok <mhroncok@redhat.com> - 5.8.0-6
|
||||||
- Drop python2-psutil
|
- Drop python2-psutil
|
||||||
Resolves: rhbz#1913682
|
Resolves: rhbz#1913682
|
||||||
|
Loading…
Reference in New Issue
Block a user