Skip to content
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

Fix shutdown_pipe test issue #54

Merged
merged 1 commit into from
Jul 26, 2020

Conversation

wishdev
Copy link
Contributor

@wishdev wishdev commented Jul 21, 2020

This addresses the test issue from #44. It appears the issue is that the server aborts for an unknown reason. There is no other way the pipe could be closed when the attempt to write to it occurs.

Looking at the test directly above the new one https://github.com/ruby/webrick/blob/1daacc18490cbc96bcf1bdc741f3ccff65a0d164/test/webrick/test_server.rb#L151-L161- it appears that it assumes that a server may not start properly and simply appears to skip the test if the server fails to start. The only way on line 156 that the thread status is a falsy value is if the thread is already dead when it is examined. That would imply the server is non-existent at that point.

The fix tries 10 times to bring up a server and if it fails to do so - it continues on.

@jeremyevans
Copy link
Contributor

For some reasons, CI didn't run all jobs when this was submitted, but after running the jobs, looks like things are working. Thanks!

@jeremyevans jeremyevans merged commit 9676704 into ruby:master Jul 26, 2020
@wishdev wishdev deleted the shutdown_pipe_config_test_fix branch July 28, 2020 20:28
@wishdev
Copy link
Contributor Author

wishdev commented Sep 25, 2020

As mentioned on #44

  1. Error:
    TestWEBrickServer#test_shutdown_pipe:
    IOError: stream closed in another thread
    /tmp/ruby/v3/src/trunk-no-theap/test/webrick/test_server.rb:180:in write' /tmp/ruby/v3/src/trunk-no-theap/test/webrick/test_server.rb:180:in puts'
    /tmp/ruby/v3/src/trunk-no-theap/test/webrick/test_server.rb:180:in block in test_shutdown_pipe' /tmp/ruby/v3/src/trunk-no-theap/test/webrick/test_server.rb:167:in loop'
    /tmp/ruby/v3/src/trunk-no-theap/test/webrick/test_server.rb:167:in `test_shutdown_pipe'
    on high load-average environments.

http://ci.rvm.jp/logfiles/brlog.trunk-no-theap.20200924-222101

So the code above this fix - test_restart_after_stop runs the exact same concept - with the difference being that server.stop swallows this error internally. So it would appear that these tests aren't actually running properly because something is closing the servers (and their shutdown_pipes) prematurely. So I guess I just swallow the IOError here as well?

wishdev added a commit to wishdev/webrick that referenced this pull request Sep 25, 2020
As mentioned in ruby#44 and ruby#54 - there continues to be issues with regards
to the server startup with regards to this test. WEBrick::GenericServer#stop
swallows an IOError internally - so the fix here is to swallow the error
during the test and to retry.
@wishdev wishdev mentioned this pull request Sep 25, 2020
jeremyevans pushed a commit that referenced this pull request Sep 25, 2020
As mentioned in #44 and #54 - there continues to be issues with regards
to the server startup with regards to this test. WEBrick::GenericServer#stop
swallows an IOError internally - so the fix here is to swallow the error
during the test and to retry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants