Git Product home page Git Product logo

Comments (11)

jbagga avatar jbagga commented on July 22, 2024

cc @halter73

from entropy.

halter73 avatar halter73 commented on July 22, 2024

I have no idea what's going on with this one. The client simply failed to establish a TCP connection. Maybe Kestrel just took too long to start this one time? That's why there's a retry.

Even though TC marked it as flaky, if you look at the test history it looks like this is the only time this test has ever failed: http://aspnetci/project.html?tab=testDetails&projectId=XPlat&testNameId=8180339492066270673&page=1

from entropy.

jbagga avatar jbagga commented on July 22, 2024

ConfigWalkingValuesWebTests.KestrelX64CoreCLR
Failure details: http://aspnetci/viewLog.html?buildId=191998&tab=buildResultsDiv&buildTypeId=XPlat_Linux_UbuntuUniverseCoreCLR.

@halter73 This one has the same error. Fails to connect and retry is canceled.

@muratg Are these rare failures acceptable?

from entropy.

Eilon avatar Eilon commented on July 22, 2024

@halter73 we want to abolish all flaky tests. We have too many flaky tests across the board, so it's a death-by-a-thousand-paper-cuts situation.

from entropy.

muratg avatar muratg commented on July 22, 2024

@natemcmaster could you take a look? (@halter73 is out this week.)

from entropy.

natemcmaster avatar natemcmaster commented on July 22, 2024

ContainerFallbackWebTests failed with

Unhandled Exception: System.IO.IOException: Failed to bind to address http://localhost:6000 on the IPv4 loopback interface: port already in use. ---> System.AggregateException: One or more errors occurred. (Error -98 EADDRINUSE address already in use) ---> Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -98 EADDRINUSE address already in use

ConfigWalkingValuesWebTests failed with the same error, but ports 5900. I couldn't find any other tests that explicitly use ports 5900 or 6000. Could this be an issue in Kestrel?

from entropy.

Eilon avatar Eilon commented on July 22, 2024

Didn't we have some automatic port selector thingy that we used somewhere for Kestrel tests? Or some other tests?

@mikeharder @Tratcher maybe you guys remember?

from entropy.

natemcmaster avatar natemcmaster commented on July 22, 2024

If we do that would help. To help debug situations like this, I'm make a pull request to make SelfHostDeployer log the status of requested port before it attempts to start the web server. See aspnet/Hosting#993

from entropy.

mikeharder avatar mikeharder commented on July 22, 2024

Most Kestrel tests specify port 0 and let the OS dynamically assign a free port. A few Kestrel tests do bind to specific ports, and we use a tiny helper method to choose a free port:

private static int GetNextPort()
{
    using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
    {
        // Let the OS assign the next available port. Unless we cycle through all ports
        // on a test run, the OS will always increment the port number when making these calls.
        // This prevents races in parallel test runs where a test is already bound to
        // a given port, and a new test is able to bind to the same port due to port
        // reuse being enabled by default by the OS.
        socket.Bind(new IPEndPoint(IPAddress.Loopback, 0));
        return ((IPEndPoint)socket.LocalEndPoint).Port;
    }
}

https://github.com/aspnet/KestrelHttpServer/blob/dev/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs#L508

This code could be copied where needed since it's so small and simple, or we could move it into a (source) shared class.

from entropy.

natemcmaster avatar natemcmaster commented on July 22, 2024

Thanks @mikeharder. I've used this approach in #216 and removed all hard-coded port numbers from tests.

from entropy.

natemcmaster avatar natemcmaster commented on July 22, 2024

#216

from entropy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.