drogonframework / drogonframework/drogon

WebSocketTest failed, if build shared in Windows and test in powershell/cmd rather than WSL shell.

Open
#1,197 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
14.3k
Forks
1.4k
Avg merge
1d 12h
Merged PRs (30d)
15

Description

**Describe the bug**
WebSocketTest failed, integration_test_client.exe abort() has been called.

**To Reproduce**
Steps to reproduce the behavior:
1. Open 'x64 Native Tools Command Prompt for VS 20XX' terminal
2. Create building and install folder
```
mkdir -p build/install
```
3. Install dependencies
```
conan install .. -s compiler="Visual Studio" -s compiler.version=16 -s build_type=Debug -g cmake_paths
```
4. Build Drogon
```
cmake .. -DBUILD_TESTING=YES -DBUILD_DROGON_SHARED=ON -DCMAKE_CXX_VISIBILITY_PRESET=hidden -DCMAKE_VISIBILITY_INLINES_HIDDEN=1 -DCMAKE_INSTALL_PREFIX="install" -DCMAKE_TOOLCHAIN_FILE="conan_paths.cmake"
cmake --build . --target install
```
5. Add build/install/bin to path
```
# if powershell, replace install/bin with your full path
$env:path+=";install/bin"
# if cmd, replace install/bin with your full path
set PATH="%PATH%;install/bin"
```
6. run integration_test_server.exe -s
7. open new terminal
8. run integration_test_client.exe -s

**Screenshots**
![image](https://user-images.githubusercontent.com/8808496/158540773-34be07bd-58c6-45b0-b83a-3aea0d338bf8.png)
```
85
In test case WebSocketTest
鈫?..\lib\tests\integration_test\client\WebSocketTest.cc:40 PASSED:
CHECK(type == WebSocketMessageType::Text)

20220316 07:15:53.450000 UTC 2056 TRACE [parse] plain data - ..\lib\src\WebSocketConnectionImpl.cc:285
20220316 07:15:53.450000 UTC 2056 TRACE [sendWsData] send 2 bytes - ..\lib\src\WebSocketConnectionImpl.cc:70
20220316 07:15:53.450000 UTC 2056 TRACE [~TcpClient] TcpClient::~TcpClient[httpClient] - connector - ..\trantor\trantor\net\TcpClient.cc:80
20220316 07:15:53.450000 UTC 2056 TRACE [handleClose] connection closed, fd=328 - ..\trantor\trantor\net\inner\TcpConnectionImpl.cc:909
20220316 07:15:53.450000 UTC 2056 TRACE [operator ()] connection disconnect - ..\lib\src\WebSocketClientImpl.cc:78
20220316 07:15:53.450000 UTC 2056 TRACE [handleClose] to call close callback - ..\trantor\trantor\net\inner\TcpConnectionImpl.cc:919
In test case WebSocketTest
鈫?..\lib\tests\integration_test\client\WebSocketTest.cc:34 PASSED:
CHECK(message.empty())

20220316 07:15:53.450000 UTC 2056 TRACE [parse] plain data - ..\lib\src\WebSocketConnectionImpl.cc:285
Integration test failed
PS D:\GitHub\drogon\build\lib\tests>
```
**Additional context**
- OS: [windows 11]
- VS: [Visual Studio 2019]

**Additional Info**
if staitc build, without this issue, just shared build have this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.