From f486f34ebe0e21f0e109e24037e73182b2cf510a Mon Sep 17 00:00:00 2001 From: Skyler Hawthorne Date: Fri, 21 Oct 2022 00:28:29 -0400 Subject: flush writes on force quit (#4397) When force quitting, we need to block on the pending writes to ensure that write commands succeed before exiting, and also to avoid a crash when all the views are gone before the auto format call returns from the LS.--- helix-term/tests/test/write.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'helix-term/tests/test/write.rs') diff --git a/helix-term/tests/test/write.rs b/helix-term/tests/test/write.rs index 6aa51a31..d0128edc 100644 --- a/helix-term/tests/test/write.rs +++ b/helix-term/tests/test/write.rs @@ -8,7 +8,7 @@ use helix_view::doc; use super::*; -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write() -> anyhow::Result<()> { let mut file = tempfile::NamedTempFile::new()?; let mut app = helpers::AppBuilder::new() @@ -92,7 +92,7 @@ async fn test_write_concurrent() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_fail_mod_flag() -> anyhow::Result<()> { let file = helpers::new_readonly_tempfile()?; let mut app = helpers::AppBuilder::new() @@ -133,7 +133,7 @@ async fn test_write_fail_mod_flag() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_scratch_to_new_path() -> anyhow::Result<()> { let mut file = tempfile::NamedTempFile::new()?; @@ -158,7 +158,7 @@ async fn test_write_scratch_to_new_path() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_scratch_no_path_fails() -> anyhow::Result<()> { helpers::test_key_sequence_with_input_text( None, @@ -179,7 +179,7 @@ async fn test_write_scratch_no_path_fails() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_auto_format_fails_still_writes() -> anyhow::Result<()> { let mut file = tempfile::Builder::new().suffix(".rs").tempfile()?; @@ -203,7 +203,7 @@ async fn test_write_auto_format_fails_still_writes() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_new_path() -> anyhow::Result<()> { let mut file1 = tempfile::NamedTempFile::new().unwrap(); let mut file2 = tempfile::NamedTempFile::new().unwrap(); @@ -249,7 +249,7 @@ async fn test_write_new_path() -> anyhow::Result<()> { Ok(()) } -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] async fn test_write_fail_new_path() -> anyhow::Result<()> { let file = helpers::new_readonly_tempfile()?; -- cgit v1.2.3-70-g09d2