microsoft / cpprestsdk

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
7.89k stars 1.63k forks source link

[MSVC] websocketsclient_test failed due to CHECK_EQUAL(ret_msg.length(), body_str.length()) where ret_msg.length()=32 and body_str.length()=5 #1785

Open Zhaojun-Liu opened 6 months ago

Zhaojun-Liu commented 6 months ago

Hi All, websocketsclient_test failed, detailed message like below, could you take a look this issue? Thanks.

8/8 Test #8: websocketsclient_test ............***Failed    9.62 sec
Loaded websocketsclient_testd.dll...
=== Running tests from: <static> ===
=== Running tests from: websocketsclient_testd.dll ===
Starting test case authentication_tests:ssl_test...
F:\gitP\microsoft\cpprestsdk\Release\tests\functional\websockets\client\authentication_tests.cpp(105): error: Failure in ssl_test: CHECK_EQUAL(ret_msg.length(), body_str.length()) where ret_msg.length()=32 and body_str.length()=5
 FAILED
F:\gitP\microsoft\cpprestsdk\Release\tests\functional\websockets\client\authentication_tests.cpp(108): error: Failure in ssl_test: CHECK_EQUAL(body_str.compare(ret_str), 0) where body_str.compare(ret_str)=1 and 0=0
 FAILED

Repro steps:

  1. git clone https://github.com/microsoft/cpprestsdk F:\gitP\microsoft\cpprestsdk
  2. git -C "F:\gitP\microsoft\cpprestsdk" reset --hard 9c65488
  3. git -C "F:\gitP\microsoft\cpprestsdk" submodule sync git -C "F:\gitP\microsoft\cpprestsdk" submodule foreach git reset --hard git -C "F:\gitP\microsoft\cpprestsdk" submodule foreach git clean -xdf git -C "F:\gitP\microsoft\cpprestsdk" submodule update --init --recursive
  4. git clone https://github.com/Microsoft/vcpkg F:\gitP\Microsoft\vcpkg
  5. git -C "F:\gitP\Microsoft\vcpkg" reset --hard d99b693
  6. cd F:\gitP\Microsoft\vcpkg
  7. bootstrap-vcpkg.bat 2>&1
  8. vcpkg.exe install --recurse openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --triplet x64-windows --clean-after-build
  9. mkdir F:\gitP\microsoft\cpprestsdk\build_amd64 & cd F:\gitP\microsoft\cpprestsdk\build_amd64
  10. cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=F:\gitP\Microsoft\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows ..
  11. msbuild /m /p:Platform=x64 /p:Configuration=Release cpprestsdk-root.sln /t:Rebuild
  12. ctest --build-config Release --output-on-failure

Detailed log: test_cpprestsdk.log

Note: The same steps and build environment worked fine last week, but failed this week.

pavel-machyniak commented 4 months ago

I have the same issue with tests. Build on Rocky Linux 9 with OpenSSL 3.0.7, boost 1.84, cpprestsdk 2.10.19.

=== Running tests from: libwebsocketsclient_test.so ===
Starting test case authentication_tests:ssl_test...
/root/cpprestsdk.git/Release/tests/functional/websockets/client/authentication_tests.cpp:105: error: Failure in ssl_test: CHECK_EQUAL(ret_msg.length(), body_str.length()) where ret_msg.length()=32 and body_str.length()=5 FAILED
/root/cpprestsdk.git/Release/tests/functional/websockets/client/authentication_tests.cpp:108: error: Failure in ssl_test: CHECK_EQUAL(body_str.compare(ret_str), 0) where body_str.compare(ret_str)=22 and 0=0 FAILED
Test case authentication_tests:ssl_test FAILED