Approach Java 25 compatibility by stages#435
Conversation
These changes improve stability of network tests, especially the impact of tear-down, and our ability to run network tests behind an HTTP proxy. These changes are cherry-picked from PR 424 whose author we credit as author here. We update lib-python/2.7/test/test_urllib2net.py from CPython 2.7.18 because the modified Lib/test/test_urllib2net.py is based on that.
| @@ -1,5 +1,3 @@ | |||
| #!/usr/bin/env python | |||
|
|
|||
| import unittest | |||
There was a problem hiding this comment.
I thought we were not allowed to modify files under lib-python?
There was a problem hiding this comment.
I have simply copied it from CPython 2.7.18. That we allow ourselves, and would do more if it didn't break so much. Since the shadowing file is based on that, it seemed a helpful thing to have as comparator.
Since there is a shadowing file, it will have no effect, except as a sort of documentation.
|
The "Java versions regrtest 2.7" action runs the usual regression test on Java 17 and 25, on Ubuntu and Windows. With the stability and proxy change in place, the baseline results are: 17, Windows: 25, Ubuntu: 25, Windows: This is the baseline against which to measure progress adding the changes specific to Java 25 from #424. |
This change is cherry-picked from PR 424. We'll regenerate the Windows laucher (compiled from jython.py) in a second step.
This was created from jython.py with PyInstaller.
|
Here I've taken just the improvements to the Some of the changes in #424 seem to be compensating the absence of this windows launcher in compiled form, or or any launcher (e.g. in the Ant script), providing options that the launcher(s) will supply. So let's see what additional passes we get just by fixing the launchers. |
|
That's a lot better. New results are: 17, Windows: passes 25, Windows: The |
| return [self.java_mem, self.java_stack] | ||
|
|
||
| @property | ||
| def java_major_version(self): |
There was a problem hiding this comment.
See #426 (comment)
Parsing output of java -version is not reliable, there are better ways.
Parsing output of java -XshowSettings:properties is recommended if a java call is deemed acceptible at all. Perhaps cleaner, cheaper, more lightweight is to read java_home/release. calling java could be a fallback if that file does not exist.
This is what I was trying to fix in the tests. In many of these tests, the previous test is relying on garbage collection rather than explicit cleanup of sockets listening on a port. That creates a race condition when a subsequent test tries to bind to the same port, making the tests flaky... |
I was disappointed too. I thought I had incorporated all such changes into the first commit on this branch, but have I missed something? |
No. Not everyone uses (or can use) this compiled Windows launcher; for example, WLST doesn't. We can get by without this compiled Windows launcher. I filed the issue simply for completeness. |
If you look back at the comments on #424, you will see that I said that I tried to fix the race conditions I ran into but that there are likely others. It is not easy to find race conditions without running into them. |
|
On further thought, I think the re-run of |
By "some of them" I mean where a test does use the launcher, including in |
The objective is to break #424 into sections with a purpose. I have already dealt with JAR updates in #431 and #432, and we have a way of testing against Java 17 and 25 in the CI that currently fails (of course) but may be run on demand.
The first stage is the changes affecting tests that improve stability and allow them to run in an environment where Internet access is via a proxy.