Add GPUI_TEST_TIMEOUT env var

Richard Feldman and Bennet Bo Fenner created

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>

Change summary

crates/gpui/src/executor.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Detailed changes

crates/gpui/src/executor.rs 🔗

@@ -281,7 +281,11 @@ impl BackgroundExecutor {
         });
         let mut cx = std::task::Context::from_waker(&waker);
 
-        let duration = Duration::from_secs(180);
+        let duration = Duration::from_secs(
+            option_env!("BLOCK_INTERNAL_TIMEOUT")
+                .and_then(|s| s.parse::<u64>().ok())
+                .unwrap_or(180),
+        );
         let mut test_should_end_by = Instant::now() + duration;
 
         loop {