]> granicus.if.org Git - python/commitdiff
bpo-29972: Skip tests known to fail on AIX (#979)
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 4 Apr 2017 08:35:15 +0000 (10:35 +0200)
committerGitHub <noreply@github.com>
Tue, 4 Apr 2017 08:35:15 +0000 (10:35 +0200)
* bpo-29972: Fix test_eintr on AIX

On AIX, sigtimedwait(0.2) sleeps 199.8 ms, whereas the test expects
200 ms or longer.

* bpo-29972: Skip some inet_pton() tests on AIX

Skip some inet_pton() tests of test_socket on AIX.

inet_pton() on AIX is less strict than on Linux and doesn't reject
some invalid IP addresses. The unit tests test more the libc than
Python itself.

* bpo-29972: Skip tests known to fail on AIX

* test_locale.test_strcoll_with_diacritic()
* test_locale.test_strxfrm_with_diacritic()
* test_strptime.test_week_of_year_and_day_of_week_calculation()
* test_tools.test_POT_Creation_Date()

Lib/test/eintrdata/eintr_tester.py
Lib/test/test_locale.py
Lib/test/test_socket.py
Lib/test/test_strptime.py
Lib/test/test_tools/test_i18n.py

index c619b3d6c38a599f81972fde715d80aa6f5b2a81..74a509b99f08c767348c01f11ad52c913584a82a 100644 (file)
@@ -380,7 +380,12 @@ class SignalEINTRTest(EINTRBaseTest):
         t0 = time.monotonic()
         signal.sigtimedwait([signal.SIGUSR1], self.sleep_time)
         dt = time.monotonic() - t0
-        self.assertGreaterEqual(dt, self.sleep_time)
+
+        if sys.platform.startswith('aix'):
+            # On AIX, sigtimedwait(0.2) sleeps 199.8 ms
+            self.assertGreaterEqual(dt, self.sleep_time * 0.9)
+        else:
+            self.assertGreaterEqual(dt, self.sleep_time)
 
     @unittest.skipUnless(hasattr(signal, 'sigwaitinfo'),
                          'need signal.sigwaitinfo()')
index 4dd300ed11047694ead50c530e1c2c43d9367df0..668f3cb5ca28931caf26acf3413ffa78d5dd3e02 100644 (file)
@@ -365,9 +365,13 @@ class TestEnUSCollation(BaseLocalizedTest, TestCollation):
             raise unittest.SkipTest('wcscoll/wcsxfrm have known bugs')
         BaseLocalizedTest.setUp(self)
 
+    @unittest.skipIf(sys.platform.startswith('aix'),
+                     'bpo-29972: broken test on AIX')
     def test_strcoll_with_diacritic(self):
         self.assertLess(locale.strcoll('à', 'b'), 0)
 
+    @unittest.skipIf(sys.platform.startswith('aix'),
+                     'bpo-29972: broken test on AIX')
     def test_strxfrm_with_diacritic(self):
         self.assertLess(locale.strxfrm('à'), locale.strxfrm('b'))
 
index 7cc2e57b0ddf74906fe49f78895a85d5bd2bb9f7..2155d630dd4790673a8cc4cd78b2f22f5ada1757 100644 (file)
@@ -1026,7 +1026,9 @@ class GeneralModuleTests(unittest.TestCase):
         self.assertEqual(b'\xaa\xaa\xaa\xaa', f('170.170.170.170'))
         self.assertEqual(b'\x01\x02\x03\x04', f('1.2.3.4'))
         self.assertEqual(b'\xff\xff\xff\xff', f('255.255.255.255'))
-        assertInvalid(f, '0.0.0.')
+        # bpo-29972: inet_pton() doesn't fail on AIX
+        if not sys.platform.startswith('aix'):
+            assertInvalid(f, '0.0.0.')
         assertInvalid(f, '300.0.0.0')
         assertInvalid(f, 'a.0.0.0')
         assertInvalid(f, '1.2.3.4.5')
@@ -1081,10 +1083,12 @@ class GeneralModuleTests(unittest.TestCase):
         assertInvalid('::0::')
         assertInvalid('1::abc::')
         assertInvalid('1::abc::def')
-        assertInvalid('1:2:3:4:5:6:')
         assertInvalid('1:2:3:4:5:6')
-        assertInvalid('1:2:3:4:5:6:7:8:')
         assertInvalid('1:2:3:4:5:6:7:8:0')
+        # bpo-29972: inet_pton() doesn't fail on AIX
+        if not sys.platform.startswith('aix'):
+            assertInvalid('1:2:3:4:5:6:')
+            assertInvalid('1:2:3:4:5:6:7:8:')
 
         self.assertEqual(b'\x00' * 12 + b'\xfe\x2a\x17\x40',
             f('::254.42.23.64')
index 2cf0926239c073c81a705483e639f84673c956df..934318025753bea5afc7d9436d808b34f047c5e7 100644 (file)
@@ -5,6 +5,7 @@ import time
 import locale
 import re
 import os
+import sys
 from test import support
 from datetime import date as datetime_date
 
@@ -482,6 +483,8 @@ class CalculationTests(unittest.TestCase):
         _ymd_excluded = ()
         _formats_excluded = ()
 
+    @unittest.skipIf(sys.platform.startswith('aix'),
+                     'bpo-29972: broken test on AIX')
     def test_week_of_year_and_day_of_week_calculation(self):
         # Should be able to infer date if given year, week of year (%U or %W)
         # and day of the week
index ce6f549879c76d5143c72bd0ac9b2cff4ad622be..5c28baea7241c281da08b65a70690a74103d9869 100644 (file)
@@ -1,6 +1,7 @@
 """Tests to cover the Tools/i18n package"""
 
 import os
+import sys
 import unittest
 
 from test.support.script_helper import assert_python_ok
@@ -53,7 +54,8 @@ class Test_pygettext(unittest.TestCase):
 
             #"Plural-Forms" is optional
 
-
+    @unittest.skipIf(sys.platform.startswith('aix'),
+                     'bpo-29972: broken test on AIX')
     def test_POT_Creation_Date(self):
         """ Match the date format from xgettext for POT-Creation-Date """
         from datetime import datetime