[Jython-checkins] jython: Skip some tests that fail on Java 9+ (issues #2362, #2630, #2710, #2711).

jeff.allen jython-checkins at python.org
Fri Oct 26 14:13:28 EDT 2018


https://hg.python.org/jython/rev/5aa64ce0b8b8
changeset:   8191:5aa64ce0b8b8
user:        Jeff Allen <ja.py at farowl.co.uk>
date:        Fri Oct 26 17:56:54 2018 +0100
summary:
  Skip some tests that fail on Java 9+ (issues #2362, #2630, #2710, #2711).

The aim is to keep build-bots green so we can see other problems as they arise,
and later to fix the issues captured at b.j.o..

files:
  Lib/test/test_classpathimporter.py |  3 +++
  Lib/test/test_dict.py              |  2 ++
  Lib/test/test_import_jy.py         |  3 +++
  Lib/test/test_socket_jy.py         |  9 ++++++---
  Lib/test/test_ssl.py               |  6 +++---
  5 files changed, 17 insertions(+), 6 deletions(-)


diff --git a/Lib/test/test_classpathimporter.py b/Lib/test/test_classpathimporter.py
--- a/Lib/test/test_classpathimporter.py
+++ b/Lib/test/test_classpathimporter.py
@@ -121,6 +121,9 @@
         self.assertFalse(loader.is_package('jar_pkg.prefer_compiled'))
 
     @unittest.skipIf(test_support.is_jython_posix, "FIXME: failing on Linux issue #2422")
+    @unittest.skipIf(test_support.get_java_version() >= (9,),
+                     "Fails on Java 9+. See b.j.o. issue #2362") # FIXME
+    # Probably related to Java modules: ensure also works outside java.base
     def test_loader_get_code(self):
         # Execute Python code out of the JAR
         jar = self.prepareJar('classimport.jar')
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -312,6 +312,8 @@
         x.fail = True
         self.assertRaises(Exc, d.setdefault, x, [])
 
+    @unittest.skipIf(test_support.is_jython and test_support.get_java_version() >= (9,),
+                     "Fails on Java 9+. See b.j.o. issue 2711.")
     def test_setdefault_atomic(self):
         # Issue #13521: setdefault() calls __hash__ and __eq__ only once.
         class Hashed(object):
diff --git a/Lib/test/test_import_jy.py b/Lib/test/test_import_jy.py
--- a/Lib/test/test_import_jy.py
+++ b/Lib/test/test_import_jy.py
@@ -172,6 +172,9 @@
         # causes a stack overflow if the bug occurs
         self.assertRaises(Exception, getattr, anygui, 'abc')
 
+    @unittest.skipIf(test_support.get_java_version() >= (9,),
+                     "Fails on Java 9+. See b.j.o. issue #2362") # FIXME
+    # Probably related to Java modules: ensure also works outside java.base
     def test_import_star(self):
         self.assertEquals(0, subprocess.call(
                 [sys.executable, test_support.findfile("import_star_from_java.py")]))
diff --git a/Lib/test/test_socket_jy.py b/Lib/test/test_socket_jy.py
--- a/Lib/test/test_socket_jy.py
+++ b/Lib/test/test_socket_jy.py
@@ -67,7 +67,7 @@
                 target=self.do_nonblocking_connection,
                 name="socket-workout-%s" % i,
                 args=(connect_results, i)))
-                           
+
         for thread in connect_threads:
             thread.start()
         for thread in connect_threads:
@@ -79,6 +79,7 @@
         # Tests fix for http://bugs.jython.org/issue2428; based in part on the
         # code showing failure that was submitted with that bug
         for result in self.do_workout():
+            if len(result) == 0: self.fail("A socket-workout thread failed to run")
             self.assertIn(result[0], {errno.EINPROGRESS, errno.EISCONN})
             self.assertEqual(result[-1], errno.EISCONN)
             for code in result[1:-1]:
@@ -124,25 +125,27 @@
                 target=self.do_nonblocking_connection,
                 name="socket-workout-%s" % i,
                 args=(connect_results, i)))
-                           
+
         for thread in connect_threads:
             thread.start()
         for thread in connect_threads:
             thread.join()
         return connect_results
 
+    @unittest.skipIf(test_support.is_jython and test_support.get_java_version() >= (9,),  # FIXME
+                     "Fails on Java 9+. See b.j.o. issue #2710")
     def test_connect_ex_workout(self):
         """Verify connect_ex states go through EINPROGRESS?, EALREADY*, EISCONN"""
         # Tests fix for http://bugs.jython.org/issue2428; based in part on the
         # code showing failure that was submitted with that bug
         for result in self.do_workout():
+            if len(result) == 0: self.fail("A socket-workout thread failed to run")
             self.assertIn(result[0], {errno.EINPROGRESS, errno.EISCONN})
             self.assertEqual(result[-1], errno.EISCONN)
             for code in result[1:-1]:
                 self.assertEqual(code, errno.EALREADY)
 
 
-
 class SocketOptionsTest(unittest.TestCase):
 
     def test_socket_options_defined(self):
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -338,7 +338,7 @@
                         "certfile must be specified for server-side operations",
                         ssl.wrap_socket, sock, server_side=True, certfile="")
         if support.get_java_version() < (9,):
-            # Possible FIXME similar issue as seen in
+            # FIXME: Fails on Java 9+. See b.j.o. issue #2710. A similar issue is seen in
             # test_load_cert_chain - apparently this RSA 1024 cert is too weak and gets a
             # java.security.KeyStoreException: Key protection  algorithm not found before the
             # ValueError raised on earlier versions of Java;
@@ -787,8 +787,8 @@
         # Combined key and cert in a single file
         ctx.load_cert_chain(CERTFILE, keyfile=None)
         if support.get_java_version() < (9,):
-            # Possible FIXME we may be skipping this test on Java 9 unnecessarily.
-            # CERTFILE as generated uses RSA 1024, which is considered too weak.
+            # FIXME: Fails on Java 9+. See b.j.o. issue #2710. A similar issue is seen in
+            # test_errors. CERTFILE as generated uses RSA 1024, which is considered too weak.
             # This may be why this raises an error on Java 9:
             # java.security.KeyStoreException: Key protection  algorithm not found:
             # java.security.KeyStoreException: Certificate chain is not valid

-- 
Repository URL: https://hg.python.org/jython


More information about the Jython-checkins mailing list