No description
Find a file
Daniel Verkamp a5f4ea09ad cros_async: tweak timeouts in cancellable_pool tests
The timeout for all pool shutdowns was set to 100 ms in a previous
change in order to make the tests run faster:
<https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004299>

However, this can lead to flakiness if the system is under load while
the tests are executing. This change makes some more careful timeout
choices to improve reliability without extending the overall time it
takes to run the tests.

Most of the shutdown_with_timeout(100ms) calls are replaced with the
normal shutdown() function, which uses a 5-second timeout. These
shutdown() calls are expected to return immediately (either because of a
non-timeout error condition or because all pool tasks are already
finished), and we can be sure that this 5-second timeout is never
relevant because all of the cros_async tests execute in under 5 seconds.
This should fix a flaky test that was observed in practice where the
disarm_with_pending_work() test would not finish shutting down in the
(rather short) 100 ms timeout previously allowed.

The shutdown_with_blocked_work timeout is reduced from the original 100
ms to 1 ms, since it should not affect the correctness of the test and
will help it run even faster. This test is also renamed to match the
actual behavior - it used to mention "panic", but the shutdown function
simply returns an error and does not panic.

Finally, the shutdown_in_progress() test now uses two different
timeouts. This test spawns a thread that waits until shutdown is in
progress, then calls the normal shutdown() function to ensure it returns
the correct error; this shutdown() call should return immediately, so
again the 5-second timeout is not relevant. The main thread of the test
now uses a timeout of 200 ms, which should be sufficient to ensure the
other thread has time to start up and reach the shutdown() call while
observing the shutdown_in_progress flag. This extends the test time
somewhat relative to the previous 100 ms timeout, but that is mostly
traded off with the timeout reduction in the blocked work test, so the
overall test time should be about the same as before. This is probably
the most likely test to be flaky going forward, since it relies on OS
thread scheduling behavior; if any problems are observed, we can
consider making the timeout longer, although this will slow down the
tests.

BUG=b:306726068
TEST=tools/dev_container tools/presubmit
TEST=time cargo test -p cros_async

Change-Id: Ic6ec117d616ae7c99a8e3c5a4fe6dd1169c72286
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4961353
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-10-22 04:05:37 +00:00
.cargo clippy: Disallow len_without_is_empty and len_zero 2023-05-22 21:27:21 +00:00
.config Enable test retries in nextest 2023-06-07 17:43:18 +00:00
.devcontainer dev_container: Replace better toml extension 2023-07-27 23:37:15 +00:00
.github Cleanup: Remove old, deprecated and no longer used files 2022-09-20 21:05:57 +00:00
.vscode Document feature flags and introduce new feature sets 2022-10-14 20:31:19 +00:00
aarch64 devices: bus: Add BusType to Bus for better debugging. 2023-10-18 23:48:40 +00:00
acpi_tables crosvm: Uprev zerocopy to 0.7.x 2023-10-10 17:34:32 +00:00
arch cros_fdt: Introduce ToFdtPropval trait 2023-10-18 10:24:15 +00:00
argh_helpers Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
audio_streams_conformance_test Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
audio_util tree-wide: apply nightly rustfmt 2023-03-27 21:30:45 +00:00
base base: upstream get_allocated_ranges 2023-10-16 22:10:19 +00:00
bit_field bit_field: suppress clippy cast warnings 2023-04-10 23:41:28 +00:00
broker_ipc crash_report: refactor product specific code 2023-06-09 23:10:04 +00:00
common data_model: eliminate unsafe code in zerocopy_from_reader() 2023-10-16 17:49:03 +00:00
cros_async cros_async: tweak timeouts in cancellable_pool tests 2023-10-22 04:05:37 +00:00
cros_fdt cros_fdt: allow newline in string values 2023-10-19 23:08:27 +00:00
cros_tracing Add AOT for GPU display. 2023-09-20 17:17:11 +00:00
cros_tracing_types Upstream cros_tracing_types. 2023-05-11 18:08:00 +00:00
crosvm_cli Fix some cargo doc warnings in Windows-only code 2023-09-22 00:59:46 +00:00
crosvm_control crosvm_control: fix typo 2023-10-18 17:34:18 +00:00
crosvm_plugin Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
devices devices: virtio: snd: add stream to vios_backend snapshot 2023-10-20 18:38:44 +00:00
disk Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
docs/book docs: add log levels to advanced_usage 2023-10-19 23:14:01 +00:00
e2e_tests Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
fuse Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
fuzz Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
gpu_display Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
hypervisor cros_fdt: Introduce ToFdtPropval trait 2023-10-18 10:24:15 +00:00
infra Roll recipe dependencies (trivial). 2023-10-20 22:34:42 +00:00
io_uring Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
jail Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
kernel_cmdline Rust 1.65: Fix clippy derive_partial_eq_without_eq lints 2022-12-01 01:32:30 +00:00
kernel_loader data_model: eliminate unsafe code in zerocopy_from_reader() 2023-10-16 17:49:03 +00:00
kvm Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
kvm_sys Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
libcras_stub devices: snd: Use PCM device client_type and stream_type for CRAS 2023-03-02 06:22:40 +00:00
linux_input_sys crosvm: Uprev zerocopy to 0.7.x 2023-10-10 17:34:32 +00:00
logo README: Use PNG logo image 2021-10-29 01:56:23 +00:00
media Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
metrics Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
net_sys Fix remaining Chrome/Chromium OS instances 2023-01-03 22:14:30 +00:00
net_util Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
perfetto Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
power_monitor Cargo.toml: upgrade protobuf 2.x -> 3.x 2023-04-28 19:32:01 +00:00
prebuilts Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
proto_build_tools Cargo.toml: upgrade protobuf 2.x -> 3.x 2023-04-28 19:32:01 +00:00
protos Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
resources Remove virtio-vhost-user (VVU) support 2023-09-05 17:59:33 +00:00
riscv64 devices: bus: Add BusType to Bus for better debugging. 2023-10-18 23:48:40 +00:00
rutabaga_gfx Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
sandbox Add paste handling into the emulator 2023-09-08 21:29:23 +00:00
serde_keyvalue serde_keyvalue: add tests for outer-braces in arguments 2023-06-09 04:59:54 +00:00
src devices: bus: Add BusType to Bus for better debugging. 2023-10-18 23:48:40 +00:00
swap Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
system_api Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
tests Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
third_party Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
tools crosvm: tools: contrib: Improve output slightly. 2023-10-19 13:27:15 +00:00
tube_transporter Fix some cargo doc warnings in Windows-only code 2023-09-22 00:59:46 +00:00
usb_sys devices: usb: Add the OWNERS file 2023-10-13 01:34:19 +00:00
usb_util devices: usb: Add the OWNERS file 2023-10-13 01:34:19 +00:00
vendor Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
vfio_sys vfio_sys: undo non-upstream change and add it with --raw-line 2023-10-11 18:06:09 +00:00
vhost Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
virtio_sys crosvm: Uprev zerocopy to 0.7.x 2023-10-10 17:34:32 +00:00
vm_control devices: bus: Add debug logs for devices and bus. 2023-10-19 20:45:16 +00:00
vm_memory Rename "unix" to "linux" in code and docs 2023-10-11 01:15:07 +00:00
win_audio win_audio: Upstream changes 2023-10-02 21:13:40 +00:00
win_util Fix some cargo doc warnings in Windows-only code 2023-09-22 00:59:46 +00:00
x86_64 devices: bus: Add BusType to Bus for better debugging. 2023-10-18 23:48:40 +00:00
.dockerignore add docker supported builds and tests 2019-05-15 13:36:19 -07:00
.envrc Automatically register tools/ on PATH 2023-03-03 00:33:15 +00:00
.gitignore Automatically register tools/ on PATH 2023-03-03 00:33:15 +00:00
.gitmodules devices: remove --software-tpm support 2023-10-02 23:28:45 +00:00
.rustfmt.toml rustfmt: add rules for imports 2023-10-11 14:54:30 +00:00
ARCHITECTURE.md docs: book: update architecture docs 2023-06-01 22:37:17 +00:00
Cargo.lock crosvm: Remove DataInit 2023-10-10 19:40:48 +00:00
Cargo.toml Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
CONTRIBUTING.md Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))] 2023-10-11 00:43:29 +00:00
DIR_METADATA DIR_METADATA: Add public buganizer component 2022-09-21 17:43:59 +00:00
LICENSE Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
mypy.ini Add python configs for consistency between IDE and CI 2022-08-16 18:33:23 +00:00
OWNERS OWNERS: Add takayas@ to OWNERS 2023-04-24 11:15:25 +00:00
OWNERS_COUNCIL Require council review for changes to Cargo.lock 2022-12-01 18:50:48 +00:00
PRESUBMIT.cfg Cleanup: Remove old, deprecated and no longer used files 2022-09-20 21:05:57 +00:00
pyproject.toml Add python configs for consistency between IDE and CI 2022-08-16 18:33:23 +00:00
README.chromeos.md crosvm: update book and doc links to crosvm.dev 2022-07-29 22:54:01 +00:00
README.md Fix remaining Chrome/Chromium OS instances 2023-01-03 22:14:30 +00:00
rust-toolchain Upgrade to 1.68.2: Set default version and rebuild container 2023-05-25 18:30:55 +00:00

crosvm - The ChromeOS Virtual Machine Monitor

crosvm is a virtual machine monitor (VMM) based on Linuxs KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the ChromeOS platform. Compared to QEMU, crosvm doesnt emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.

crosvm is currently used to run Linux/Android guests on ChromeOS devices.

Logo