New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Framework Update (Draft, review only) #3267
base: master
Are you sure you want to change the base?
Conversation
What's the motivation behind |
Re the minissl commit, I may revert that. Still doing work re the JRuby issue, as both failures in the CI run here successfully completed the tests. Also, there are some issues with closing spawned servers using SSL listeners (possibly OS/platform related), still working on it. Re this PR, it's more about getting more 'eyes' looking at the test framework API. I suppose I could have pushed the changes to a branch here, instead of doing a PR... |
…quest setup variables, ssl ctx
fb16ba5
to
17603c1
Compare
Just ran CI in my fork with master and the work branch I've got this code in. Ran both in my fork, since I have an individual 'Pro' account, I have a higher CI concurrency limit than a standard org account (puma). Note the time difference, and the fact that the updated test suite has no failures. I've removed all the 'allow failure' code.
The current log of the test suite run on master is at https://github.com/puma/puma/actions/workflows/tests.yaml?query=branch%3Amaster. Several failed runs. I've had the work branch fail also, but it's much less frequent. It's been about 6-1/2 weeks since this was opened. Not any feedback re the test suite updates. Also no feedback about how to break the PR up into smaller PR's. |
# Maximum random number | ||
MAX = 36**6 # < 0x100000000 | ||
|
||
# Returns new random string upto 6 bytes | ||
def next | ||
rand(0x100000000).to_s(36) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this the idea here?
# Maximum random number | |
MAX = 36**6 # < 0x100000000 | |
# Returns new random string upto 6 bytes | |
def next | |
rand(0x100000000).to_s(36) | |
# Maximum random number | |
MAX = 36**6 # < 0x100000000 | |
# Returns new random string upto 6 bytes | |
def next | |
rand(MAX).to_s(36) |
super | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this fix help in master? I noticed this test failing in master (https://github.com/puma/puma/actions/runs/7160776392/job/19495517337#step:8:874) but I couldn't make sense of it (systemd plugin should not be loaded on JRuby, code has guard against JRUBY_VERSION
constant)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess not, I see more test have the same super
call, it is how TestIntegration
works.
puma/test/helpers/integration.rb
Line 27 in 08e71a2
def setup |
Still curious if you @MSP-Greg have any theories about the TestPluginSystemdJruby
master failures :)
@@ -59,6 +59,7 @@ module TestPuma | |||
module PumaSocket | |||
GET_10 = "GET / HTTP/1.0\r\n\r\n" | |||
GET_11 = "GET / HTTP/1.1\r\n\r\n" | |||
GET_11_CLOSE = "GET / HTTP/1.1\r\nConnection: close\r\n\r\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't see anything using this constant?
assert(system(*args, out: File::NULL, err: File::NULL)) | ||
end | ||
|
||
def restart_server_and_listen(argv, log: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test/helpers/integration.rb has a method named like this, it looks unused, should we remove that one?
This is awesome work. No question about it. It will be much easier to maintain and contribute to Puma if we get the CI stable. We can probably go ahead with these changes as they're only changing test files.
It is a big PR. I pointed out a few things I happened to see now, but I have far from looked at everything. I work on Puma when I feel like it, when I think I have some time over. It is almost never a block of several hours. I forgot about this. I think smaller PR was a successful way to go: https://github.com/puma/puma/pulls?q=is%3Apr+%22PumaSocket%22 |
Thanks for your comments. I haven't recently had the time to work on this that I'd like, including looking at your comments. I rebased on master, and some odd things are happening with all Ruby master builds. I also follow ruby/ruby's CI, and there are no problems there. Recently, CI for Windows builds is running much faster and is more stable. Some of the issues have to do with GC finalizers called on Hopefully, more info to come. Regardless, Happy Holidays and Merry Christmas. Not really religious, but I appreciate the more secular ideas about Christmas and the Holidays. Sorry if anyone is offended by the mention. |
Description
This is the branch I've been working on the test framework in. The first and last commits are framework related, most of the middle commits are revisions to single test files.
Looking for review re the API, method names, organization, etc. Pick your favorite test files, find the commits, and review the diffs...
A few points:
require
code.I have started doc'ing the code, see the doc at https://msp-greg.github.io/puma_test/. All the test modules/classes are children of the TestPuma module at the bottom of the class list.
Once people have reviewed this, I'd start with a PR of the test framework files, then submit a PR for each test file update? Or, we could commit several without squashing the commits when merging...
Finally, the current test system divides test files by the server type used (in-process or spawned/IO.popen). This PR follows with the same idea. I think they could be combined, so one test file could contain both server types. Thoughts?
Thanks in advance.
Your checklist for this pull request
[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.