Skip to content

Commit

Permalink
Fix Windows hang in testing (#417)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
bifurcation authored Dec 15, 2023
1 parent 22c9ef2 commit 56f23eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,10 @@ jobs:
run: |
cmake --build "${{ env.BUILD_DIR }}" --target test
## XXX(RLB): Unit tests are currently disabled on Windows because of two
## conflicting bugs. On the one hand, doctest has a bug that causes
## doctest_discover_tests to fail when tests are built with sanitizers. On the
## other hand, if tests are not built with sanitizers, then the unit tests hang
## in the middle of the test run.
##
## - name: Unit Test (Windows)
## if: matrix.os == 'windows-latest'
## run: |
## cmake --build "${{ env.BUILD_DIR }}" --target RUN_TESTS
- name: Unit Test (Windows)
if: matrix.os == 'windows-latest'
run: |
cmake --build "${{ env.BUILD_DIR }}" --target RUN_TESTS
interop-test:
if: github.event.pull_request.draft == false
Expand Down
8 changes: 8 additions & 0 deletions include/mls/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ template<class... Ts>
struct overloaded : Ts...
{
using Ts::operator()...;

// XXX(RLB) MSVC has a bug where it incorrectly computes the size of this
// type. Microsoft claims they have fixed it in the latest MSVC, and GitHub
// claims they are running a version with the fix. But in practice, we still
// hit it. Including this dummy variable is a work-around.
//
// https://developercommunity.visualstudio.com/t/runtime-stack-corruption-using-stdvisit/346200
int dummy = 0;
};

// clang-format off
Expand Down

0 comments on commit 56f23eb

Please sign in to comment.