Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/test/disconnected.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ TEST_CASE("disconnected,handler,3")
});

WaitForSingleObject(signal.get(), INFINITE);
// Give some time for to_hresult() to complete.
Sleep(500);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we build this buffer into the test that fiddles with winrt_to_hresult_handler rather than the test(s) that observe the fiddling? I think there's only one place where this is tested (custom_error.cpp).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think putting this in the disconnected test itself is better because it makes sure (or at least tries to) that any code related to this test running on the worker thread has really finished before leaving the test scope. In case it actually causes std::terminate, Catch2 can report that the abnormal termination happens during the correct test, instead of making it look like another test which happens to be running afterwards caused it. (This actually did happen to these tests before PR #1225.)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

}

TEST_CASE("disconnected,handler,4")
Expand Down Expand Up @@ -134,6 +136,8 @@ TEST_CASE("disconnected,handler,5")
});

WaitForSingleObject(signal.get(), INFINITE);
// Give some time for to_hresult() to complete.
Sleep(500);
}

// Custom action to simulate an out-of-process server that crashes before it can complete.
Expand Down
4 changes: 4 additions & 0 deletions test/test_win7/disconnected.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ TEST_CASE("disconnected,3")
});

WaitForSingleObject(signal.get(), INFINITE);
// Give some time for to_hresult() to complete.
Sleep(500);
}

TEST_CASE("disconnected,4")
Expand Down Expand Up @@ -123,4 +125,6 @@ TEST_CASE("disconnected,5")
});

WaitForSingleObject(signal.get(), INFINITE);
// Give some time for to_hresult() to complete.
Sleep(500);
}