Skip to content

test server with invalid port number #17492

Closed

Description

@icing

I did this

make a PR, have CI jobs run. Sometimes the tests fail with the following in the log:

[0-x] == Info: Unsupported proxy syntax in '127.0.0.1:[not': Port number was not a decimal number between 0 and 65535

Sporadically. There seems to be a race somewhere in retrieving ports numbers from started servers.

I expected the following

reliable port recoognition or report that a test server did not start properly.

curl/libcurl version

curl 8.14.1.-DEV

operating system

github CI

Activity

  1. bagder commented on May 30, 2025

    @bagder
    Member

    The http-proxy server is supposed to be started completely synchronously before the test case runs, and once started, the port should be known...

    curl/tests/servers.pm

    Lines 2452 to 2470 in 54834b4

    elsif($what eq "http-proxy") {
    if($run{'http-proxy'} &&
    !responsive_http_server("http", $verbose, "proxy",
    protoport("httpproxy"))) {
    if(stopserver('http-proxy')) {
    return ("failed stopping unresponsive HTTP-proxy server", 3);
    }
    }
    if(!$run{'http-proxy'}) {
    ($serr, $pid, $pid2, $PORT{"httpproxy"}) =
    runhttpserver("http", $verbose, "proxy");
    if($pid <= 0) {
    return ("failed starting HTTP-proxy server", $serr);
    }
    logmsg sprintf ("* pid http-proxy => %d %d\n", $pid, $pid2)
    if($verbose);
    $run{'http-proxy'}="$pid $pid2";
    }
    }

  2. icing commented on May 31, 2025

    @icing
    ContributorAuthor

    If I add a sleep(1000); in util.c:349 I can reproduce this.

    The server has started, but the writing of the port file takes more time. The runner needs to wait for the portfile to give a meaningful result or fail the start. I try to add something.

  3. added a commit that references this issue on May 31, 2025
  4. icing commented on May 31, 2025

    @icing
    ContributorAuthor

    #17495 should fix this.

  5. added a commit that references this issue on May 31, 2025
    759d33a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions