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 test_server spec helper to not leak fiber #7612

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

straight-shoota
Copy link
Member

Extracted from #7197

Refactors test_server spec helper to avoid leaking a fiber.

As described in #7197 (comment) load testing this change introduces Connection reset by peer errors on MacOS (@asterite Which version exactly did you test it on?). That's why this was extracted from the previous PR in order to merge the other features while this needs more investigation.

I can't debug on MacOS, so I'd be happy to get some help here.

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:concurrency kind:refactor help wanted This issue is generally accepted and needs someone to pick it up kind:specs topic:stdlib:networking platform:darwin labels Apr 2, 2019
@asterite
Copy link
Member

asterite commented Apr 2, 2019

Mac OSX Mojave. I just ran it locally:

$ bin/crystal spec spec/std/http/client/client_spec.cr 
............E......

Failures:

  1) HTTP::Client doesn't read the body if request was HEAD

       Error reading socket: Connection reset by peer (Errno)
         from src/socket.cr:59:9 in 'unbuffered_read'
         from src/io/buffered.cr:201:5 in 'fill_buffer'
         from src/io/buffered.cr:90:7 in 'peek'
         from src/io.cr:632:37 in 'gets'
         from src/io.cr:591:5 in 'gets'
         from src/http/client/response.cr:25:11 in 'from_io?'
         from src/http/client.cr:562:5 in 'exec_internal_single'
         from src/http/client.cr:548:5 in 'exec_internal'
         from src/http/client.cr:544:5 in 'exec'
         from src/http/client.cr:666:5 in 'exec'
         from src/http/client.cr:370:3 in 'get'
         from spec/std/http/client/client_spec.cr:184:20 in '->'
         from src/spec/methods.cr:255:3 in 'it'
         from spec/std/http/client/client_spec.cr:179:5 in '->'
         from src/spec/context.cr:255:3 in 'describe'
         from src/spec/methods.cr:16:5 in 'describe'
         from spec/std/http/client/client_spec.cr:46:3 in '__crystal_main'
         from src/crystal/main.cr:97:5 in 'main_user_code'
         from src/crystal/main.cr:86:7 in 'main'
         from src/crystal/main.cr:106:3 in 'main'
       

Finished in 582.55 milliseconds
19 examples, 0 failures, 1 errors, 0 pending

Failed examples:

crystal spec spec/std/http/client/client_spec.cr:179 # HTTP::Client doesn't read the body if request was HEAD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted This issue is generally accepted and needs someone to pick it up kind:bug A bug in the code. Does not apply to documentation, specs, etc. kind:refactor kind:specs platform:darwin topic:stdlib:concurrency topic:stdlib:networking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants