crosvm/win_util
Richard Otap 616e84ae54 win_util: Fix DLL notification tests
The DLL notification tests were flaky because we were trying to test an
operation that is somewhat asynchronous from the actions of the test
itself. We would see failures at a pretty low rate because the DLL we
were trying to observe unloads for would not necessarily unload
immediately, or within a short timeout of when we would expect it to
unload.

This was exacerbated by the test using the same DLL for the load and
unload portions of the test. This would add another layer of
nondeterminism about what the state of the test runner process was which
we were trying to deterministically observe.

We can fix this by doing two things:

  1. Introduce some synchronization to allow us to wrangle the
     asynchronous nature of the test.
  2. Use different DLLs for the load and unload tests.

By implementing these changes, the flakiness doesn't appear anymore
after running the test a few thousand times.

BUG: b:229288169
TEST: cargo test --package win_util --lib -- dll_notification
Change-Id: Id6aa216ed91bd9e13523118bcee1b352d511a883
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4062048
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Richard Otap <rotap@google.com>
2022-11-29 04:03:47 +00:00
..
src win_util: Fix DLL notification tests 2022-11-29 04:03:47 +00:00
build.rs Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
Cargo.toml crosvm: move enum ProcessType to win_util. 2022-09-21 19:28:49 +00:00