[MSVC][CTest] Folly encountered 4 errors while running CTest
We are utilizing Folly as a part of RWC testing to optimize MSVC compilers. Recently, Folly successfully built with MSVC but encountered 4 errors while running CTest.
The following tests FAILED:
543 - fs_util_test.Simple.UniquePath (Failed)
544 - fs_util_test.Simple.UniquePathDefaultModel (Failed)
981 - ssl_session_test.SSLSessionTest.BasicTest (Failed)
982 - ssl_session_test.SSLSessionTest.NullSessionResumptionTest (Failed)
Errors while running CTest
Step to reproduce:
- Open VS2022 x64 command prompt.
- set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
- set _CL_=/DGLOG_NO_ABBREVIATED_SEVERITIES /DNOMINMAX /DGLOG_USE_GLOG_EXPORT
- mkdir C:\gitP\Mircosoft C:\gitP\facebook
- git -C "C:\gitP\Microsoft" clone https://github.com/microsoft/vcpkg.git
- cd /d C:\gitP\Microsoft\vcpkg
- bootstrap-vcpkg.bat 2>&1
- vcpkg.exe install --x-asset-sources=x-azurl,https://vcpkg.storage.devpackages.microsoft.io/artifacts/;x-block-origin --x-buildtrees-root=C:\vcpkgbt --keep-going --recurse boost-context boost-crc boost-filesystem boost-multi-index boost-program-options boost-random boost-regex boost-thread double-conversion fmt glog gtest libevent libsodium openssl snappy zlib zstd lz4 liblzma bzip2 --triplet x64-windows --clean-after-build 2>&1
- git -C "C:\gitP\facebook" clone https://github.com/facebook/folly.git
- mkdir C:\gitP\facebook\folly\build_amd64
- cd /d C:\gitP\facebook\folly\build_amd64
- cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=C:\gitP\Microsoft\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_TESTS=ON ..
- ninja
- ctest --build-config Release --output-on-failure -R "fs_util_test.*|ssl_session_*" 2>&1
Expected result: They passed.
Actual result:
C:\gitP\facebook\folly\folly\experimental\io\test\FsUtilTest.cpp(107): error: Value of: res
Expected: matches regular expression "foo-[0-9a-f]{2}-bar-[0-9a-f]{2}-baz-[0-9a-f]{2}-cat-[0-9a-f]{2}-dog-[0-9a-f]{2}-bat-[0-9a-f]{2}-rat-[0-9a-f]{2}-tar-[0-9a-f]{2}-bar"
Actual: "foo-b7-bar-8c-baz-53-cat-92-dog-bd-bat-c5-rat-7e-tar-ef-bar"
[ FAILED ] Simple.UniquePath (32 ms)
[----------] 1 test from Simple (32 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (32 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] Simple.UniquePath
1 FAILED TEST
C:\gitP\facebook\folly\folly\experimental\io\test\FsUtilTest.cpp(119): error: Value of: res
Expected: matches regular expression "([0-9a-f]{4}-){3}[0-9a-f]{4}"
Actual: "3398-23e0-db02-e93d"
[ FAILED ] Simple.UniquePathDefaultModel (19 ms)
[----------] 1 test from Simple (20 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (20 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] Simple.UniquePathDefaultModel
1 FAILED TEST
Start 981: ssl_session_test.SSLSessionTest.BasicTest
5/6 Test #981: ssl_session_test.SSLSessionTest.BasicTest ...................***Failed 0.02 sec
Note: Google Test filter = SSLSessionTest.BasicTest
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SSLSessionTest
[ RUN ] SSLSessionTest.BasicTest
unknown file: error: C++ exception with description "boost::filesystem::read_symlink: The system cannot find the path specified [system:3]: "/proc/self/exe"" thrown in SetUp().
[ FAILED ] SSLSessionTest.BasicTest (6 ms)
[----------] 1 test from SSLSessionTest (6 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (6 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] SSLSessionTest.BasicTest
1 FAILED TEST
Start 982: ssl_session_test.SSLSessionTest.NullSessionResumptionTest
6/6 Test #982: ssl_session_test.SSLSessionTest.NullSessionResumptionTest ...***Failed 0.02 sec
Note: Google Test filter = SSLSessionTest.NullSessionResumptionTest
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SSLSessionTest
[ RUN ] SSLSessionTest.NullSessionResumptionTest
unknown file: error: C++ exception with description "boost::filesystem::read_symlink: The system cannot find the path specified [system:3]: "/proc/self/exe"" thrown in SetUp().
[ FAILED ] SSLSessionTest.NullSessionResumptionTest (6 ms)
[----------] 1 test from SSLSessionTest (6 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (6 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] SSLSessionTest.NullSessionResumptionTest
1 FAILED TEST
Logs: ctest.log
OS: Windows Server 2022 Datacenter
Simple.UniquePath and Simple.UniquePathDefaultModel feel like there's a compiler issue at play, as the Actual values do appear to match the regex they are supposed to be matching.
The SSLSessionTest is more interesting, as boost seems to believe it's running on linux? There's no reference in our side of the code to /proc/self/exe.
That said, we've caused some issues while working through the process of getting OSS Folly building with Buck2, and one of those issues caused our internal version of folly-config.h (which hard-codes a bunch of stuff) to be used rather than generating it properly via CMake, so it's possible something about that has confused boost or even gtest itself. We should hopefully have the repo back into a good state by the end of the week for the next release.
Thanks for the update, I noticed that if SSLSessionTest is using commit d2e577a, the test will pass on Windows.
Closing this issue as these tests no longer fail.