Skip to content

Commit 56f23eb

Browse files
authored
Fix Windows hang in testing (#417)
* Move bytes library to Catch2 * Convert tls_syntax to Catch2 * Convert hpke to Catch2 * Convert mls_vectors to Catch2 * Convert main test directory to Catch2 * Make remaining vcpkg changes * Re-enable unit tests on Windows * Align vcpkg files on the same baseline * Upgrade to Catch2 version 3 * Re-enable sanitizers to see if they fix Windows hangs * Revert changes to CI * Re-enable tests and disable message protection test * Disable tree hashes test * Turn off more tests * Turn off yet more tests * Turn off still more tests * Turn off one more test * Add tmate debugging * Run tmate on Windows * Re-enable tests * Update CI workflow * Profile down and instrument test vector test * Remove verify lines * More printf debugging! * Destructure return * Minimize more * Go ahead and build/run in the runner * Quote arguments? * Simplify return value * Remove all the logic * Silence error * Invoke var::visit * Really remove *all* the logic * Silence compiler error * Everything but the var::visit * Merely define the variant function * Add __declspec work-around * Shift to dummy member work-around * Take the brakes off * Take the brakes all the way off * Turn tmate back on * Take the brakes all the way off * Expand comment on work-around * Re-enable Windows unit tests
1 parent 22c9ef2 commit 56f23eb

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.github/workflows/main_ci.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,10 @@ jobs:
6363
run: |
6464
cmake --build "${{ env.BUILD_DIR }}" --target test
6565
66-
## XXX(RLB): Unit tests are currently disabled on Windows because of two
67-
## conflicting bugs. On the one hand, doctest has a bug that causes
68-
## doctest_discover_tests to fail when tests are built with sanitizers. On the
69-
## other hand, if tests are not built with sanitizers, then the unit tests hang
70-
## in the middle of the test run.
71-
##
72-
## - name: Unit Test (Windows)
73-
## if: matrix.os == 'windows-latest'
74-
## run: |
75-
## cmake --build "${{ env.BUILD_DIR }}" --target RUN_TESTS
66+
- name: Unit Test (Windows)
67+
if: matrix.os == 'windows-latest'
68+
run: |
69+
cmake --build "${{ env.BUILD_DIR }}" --target RUN_TESTS
7670
7771
interop-test:
7872
if: github.event.pull_request.draft == false

include/mls/common.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ template<class... Ts>
8383
struct overloaded : Ts...
8484
{
8585
using Ts::operator()...;
86+
87+
// XXX(RLB) MSVC has a bug where it incorrectly computes the size of this
88+
// type. Microsoft claims they have fixed it in the latest MSVC, and GitHub
89+
// claims they are running a version with the fix. But in practice, we still
90+
// hit it. Including this dummy variable is a work-around.
91+
//
92+
// https://developercommunity.visualstudio.com/t/runtime-stack-corruption-using-stdvisit/346200
93+
int dummy = 0;
8694
};
8795

8896
// clang-format off

0 commit comments

Comments
 (0)