Skip to content

Conversation

@smanders
Copy link
Collaborator

@smanders
Copy link
Collaborator Author

curl test failed on Linux

[ RUN      ] CurlTest.HttpGetRequest
/__w/buildpro/buildpro/test/curl.cpp:94: Failure
Expected: (response.find("<html")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
Response doesn't appear to be HTML

[  FAILED  ] CurlTest.HttpGetRequest (49 ms)

Windsurf Cascade's take:

The test is failing because it's trying to fetch content from http://example.org and verify it contains an HTML tag, but it's not receiving the expected response. Here's what's happening:

  1. The test makes an HTTP GET request to http://example.org
  2. It expects the response to contain an HTML tag (<html)
  3. The response is either empty or doesn't contain the expected HTML content

This is likely a network-related issue rather than a code problem. Here are the most likely causes:

  1. Network Connectivity: The CI system might not have internet access or is behind a proxy
  2. Temporary Outage: example.org might have been temporarily unavailable
  3. Rate Limiting: The CI system might be rate-limited from example.org
  4. SSL/TLS Issues: The test is disabling SSL verification, but there might still be handshake issues

@smanders
Copy link
Collaborator Author

Windsurf Cascade

I've enhanced the HttpGetRequest test to be more resilient with these improvements:

  1. More Reliable Endpoint:
    • Switched from http://example.org to https://example.com for better stability
  2. Retry Logic:
    • Added a retry mechanism with exponential backoff (3 attempts by default)
    • Each retry waits longer than the previous one (1s, 2s, 4s) to handle temporary network issues
  3. Better Error Handling:
    • More detailed error messages that include the specific cURL error and error buffer
    • Clear indication of which attempt failed and how many retries remain
  4. Improved Validation:
    • Checks both for successful HTTP response AND valid HTML content
    • Separates the success condition from the final assertions for better test reporting
  5. Resource Management:
    • Properly clears the response and error buffers between retries
    • Uses std::this_thread::sleep_for for cross-platform compatibility

The test will now:

  1. Try up to 3 times to get a successful response
  2. Wait longer between each attempt (exponential backoff)
  3. Provide detailed error messages if all attempts fail
  4. Only fail if all retry attempts are exhausted

This should make the test much more resilient to temporary network issues while still catching real problems. The test will now only fail if there's a consistent issue rather than a transient network problem.

@smanders smanders merged commit c298583 into dev Nov 12, 2025
8 checks passed
@smanders smanders deleted the openssl branch November 12, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cmake/pros: openssl devel package

2 participants