Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[HttpListener] Hang of System.Net.HttpListener.Tests in CI #21940

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

Open
danmoseley opened this issue May 24, 2017 · 40 comments
Open

[HttpListener] Hang of System.Net.HttpListener.Tests in CI #21940

danmoseley opened this issue May 24, 2017 · 40 comments
Labels
area-System.Net disabled-test The test is disabled in source code against the issue os-mac-os-x macOS aka OSX test-run-core Test failures in .NET Core test runs
Milestone

Comments

@danmoseley
Copy link
Member

https://ci.dot.net/job/dotnet_corefx/job/master/job/ubuntu14.04_debug_prtest/8257/consoleFull#130661499679494335-f7bd-47d0-8771-8661e00c2db2

22:05:43   Finished running tests. End time=05:05:43. Return value was 0
23:44:38 
Build timed out (after 120 minutes). Marking the build as aborted.
23:44:38 
Build was aborted
23:44:38 [xUnit] [INFO] - Starting to record.
23:44:38 [xUnit] [INFO] - Processing xUnit.Net-v2 (default)
23:44:38 
MSBUILD : error MSB4166: Child node "2" exited prematurely. Shutting down. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt.
23:44:38 [xUnit] [INFO] - [xUnit.Net-v2 (default)] - 155 test report file(s) were found with the pattern 'bin/**/testResults.xml' relative to '/mnt/j/workspace/dotnet_corefx/master/ubuntu14.04_debug_prtest' for the testing framework 'xUnit.Net-v2 (default)'.
23:44:38 /mnt/j/workspace/dotnet_corefx/master/ubuntu14.04_debug_prtest/Tools/tests.targets(345,5): warning MSB5021: "sh" and its child processes are being terminated in order to cancel the build. [/mnt/j/workspace/dotnet_corefx/master/ubuntu14.04_debug_prtest/src/System.Net.HttpListener/tests/System.Net.HttpListener.Tests.csproj]
23:44:39 Command execution failed with exit code 143.

Not actionable based on this information, but starting an issue.

@danmoseley
Copy link
Member Author

fyi @hughbe @stephentoub note these are in master.

@karelz karelz changed the title Hang of System.Net.HttpListener.Tests in CI [HttpListener] Hang of System.Net.HttpListener.Tests in CI May 24, 2017
@karelz
Copy link
Member

karelz commented May 24, 2017

Questions:

  • Does it happen only on Linux/Mac (product issue), or also on Windows (test issue)

@mellinoe
Copy link
Contributor

If we see this actively hung in any CI jobs, please let me know and I will try to debug it. Bonus points to anyone who logs into a machine and attaches a debugger before the process terminates 😄

@stephentoub
Copy link
Member

stephentoub commented May 25, 2017

Managed to catch one in CI. At least in the one I saw, it appears to be hanging here:
https://github.com/dotnet/corefx/blob/bbb63de0aac837895542e1b126ef71b3ba1a51aa/src/System.Net.HttpListener/tests/HttpRequestStreamTests.cs#L68

@geoffkizer, looks like this might be the same hang you're investigating locally...

@geoffkizer
Copy link
Contributor

Yep, that's exactly what I see locally.

@danmoseley
Copy link
Member Author

@stephentoub @geoffkizer does this mean if we disable Read_FullLengthAsynchronous_Success it will avoid this hang? If so could one of you please disable it?
There is no need to go through CI for this, as it's so impactful I suggest hitting merge immediately.

@stephentoub
Copy link
Member

stephentoub commented May 25, 2017

does this mean if we disable Read_FullLengthAsynchronous_Success it will avoid this hang?

I don't think so; I think there are several (not sure how many) tests that hit the same underlying issue or issues. I don't believe it's a problem with a specific test, but rather with something in the implementation (or something systemic to many tests via code that's shared between them). It's possible we could find and disable enough tests to avoid the hangs.

@geoffkizer has been investigating...

@stephentoub
Copy link
Member

But I'll see if I can temporarily disable enough to minimize the impact...

@stephentoub
Copy link
Member

stephentoub commented May 25, 2017

A bunch of tests have been temporarily disabled. Just search for 20246 to find them. Let's try to get to the bottom of this asap. Hopefully I disabled enough to prevent the hangs in CI.

@danmoseley
Copy link
Member Author

@stephentoub stephentoub self-assigned this May 26, 2017
@karelz
Copy link
Member

karelz commented May 31, 2017

@mellinoe was there any progress on tracking down the root cause of the hangs?

@mellinoe
Copy link
Contributor

@karelz I think @stephentoub had caught this (or a related test) under a debugger at one point. I was not able to successfully get a local repro despite running the tests in a loop for a long time.

@stephentoub
Copy link
Member

@geoffkizer and I fixed the issues we knew about. It's possible there's another lurking.

@stephentoub
Copy link
Member

Might be worth running the tests in a loop on macOS for a while and seeing if we can get something to hang.

@karelz
Copy link
Member

karelz commented Jun 1, 2017

@mellinoe can you please help? (if you don't have Mac, we could ask @wfurt to run it on his Mac ...)

@mellinoe
Copy link
Contributor

mellinoe commented Jun 1, 2017

I borrowed a MacBook and will try running the tests in a loop here, once I've got my environment sync'd up.

@danmoseley
Copy link
Member Author

This is now the most impactful of all corefx test issues.

@mellinoe
Copy link
Contributor

mellinoe commented Jun 2, 2017

@stephentoub and I spent several hours debugging this earlier today, and we weren't able to identify the exact problem yet. We saw some strange things that made us doubt the validity of the info coming from lldb/SOS, and ended up stumped for now.

At the very least, the MacBook I'm using is able to reproduce the issue almost every single time I run the tests. So further investigations should be easy to do.

@KristinXie1
Copy link

@Priya91
Copy link
Contributor

Priya91 commented Jun 12, 2017

@mellinoe Can you share the repro that you used for this.. Did you run the httplistener tests in loop or full test run? Were you able to identify the test that's hanging?

@mellinoe
Copy link
Contributor

@Priya91 There are several tests that hang. It repros on your laptop every time, just doing a regular run of the test project by itself.

@danmoseley
Copy link
Member Author

Need an update from @mellinoe who has been investigating this.

@mellinoe
Copy link
Contributor

I've debugged through a few repros at this point, but I haven't identified a root cause. One repro was hung in this method, https://github.com/dotnet/corefx/blob/master/src/System.Net.HttpListener/src/System/Net/Managed/HttpListenerRequest.Managed.cs#L302, in what could potentially be an infinite loop. That's the closest we've gotten to the bottom of this.

@danmoseley
Copy link
Member Author

Per @karelz moving to 2.0
• OSX only
• Not clear it's a product bug.
• HttpListener is compat API only (we do not plan to evolve it)
• ASP.NET does not depend on it
• If it is test bug, we can fix it in servicing branch.
• If it is product bug we can service.

@KristinXie1

This comment has been minimized.

@wfurt
Copy link
Member

wfurt commented Jun 8, 2018

I think the last association is incorrect: [UPDATE] The referenced comment was hidden as off-topic by @karelz

2017-07-16 17:48:30,947: INFO: proc(54): run_and_log_output: Output: System.Net.Sockets.SocketException : Too many open files in system

This seems to be clearly environmental issues.
As far as I can tell, we have no seen this one in long time.
I suggest to close it @karelz and we can open it back (or create new one) if it ever happens again.

@karelz
Copy link
Member

karelz commented Jun 8, 2018

Closing per @wfurt's analysis above.

@karelz karelz closed this as completed Jun 8, 2018
@stephentoub
Copy link
Member

There are two tests disabled against this issue:

[ActiveIssue("https://github.com/dotnet/corefx/issues/20246")] // CI hanging frequently
[ActiveIssue("https://github.com/dotnet/corefx/issues/19534", TestPlatforms.OSX)]
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task Write_HeadersToClosedConnectionAsynchronously_ThrowsHttpListenerException(bool ignoreWriteExceptions)

[ActiveIssue("https://github.com/dotnet/corefx/issues/20246")] // CI hanging frequently
[ActiveIssue("https://github.com/dotnet/corefx/issues/19534", TestPlatforms.OSX)]
[Theory]
[InlineData(true)]
[InlineData(false)]
public async Task Write_HeadersToClosedConnectionSynchronously_ThrowsHttpListenerException(bool ignoreWriteExceptions)

@stephentoub stephentoub reopened this Jan 23, 2020
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
@karelz karelz modified the milestones: Future, 5.0 Feb 23, 2020
@karelz karelz modified the milestones: 5.0, Future May 7, 2020
@wfurt wfurt self-assigned this Oct 23, 2020
@wfurt wfurt removed their assignment Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net disabled-test The test is disabled in source code against the issue os-mac-os-x macOS aka OSX test-run-core Test failures in .NET Core test runs
Projects
None yet
Development

No branches or pull requests

9 participants