@@ -1804,7 +1804,7 @@ impl Config {
18041804
18051805 pub async fn start_test < T > ( & self , test_fn : impl FnOnce ( CubeServices ) -> T )
18061806 where
1807- T : Future < Output = ( ) > + Send ,
1807+ T : Future < Output = Result < ( ) , CubeError > > + Send ,
18081808 {
18091809 self . start_test_with_options :: < _ , T , _ , _ > (
18101810 true ,
@@ -1822,7 +1822,7 @@ impl Config {
18221822
18231823 pub async fn start_migration_test < T > ( & self , test_fn : impl FnOnce ( CubeServices ) -> T )
18241824 where
1825- T : Future < Output = ( ) > + Send ,
1825+ T : Future < Output = Result < ( ) , CubeError > > + Send ,
18261826 {
18271827 self . start_migration_test_with_options :: < _ , T , _ , _ > (
18281828 Option :: <
@@ -1839,7 +1839,7 @@ impl Config {
18391839
18401840 pub async fn start_test_worker < T > ( & self , test_fn : impl FnOnce ( CubeServices ) -> T )
18411841 where
1842- T : Future < Output = ( ) > + Send ,
1842+ T : Future < Output = Result < ( ) , CubeError > > + Send ,
18431843 {
18441844 self . start_test_with_options :: < _ , T , _ , _ > (
18451845 false ,
@@ -1861,7 +1861,7 @@ impl Config {
18611861 test_fn : impl FnOnce ( CubeServices ) -> T2 ,
18621862 ) where
18631863 T1 : Future < Output = ( ) > + Send ,
1864- T2 : Future < Output = ( ) > + Send ,
1864+ T2 : Future < Output = Result < ( ) , CubeError > > + Send ,
18651865 {
18661866 self . start_test_with_options ( true , Some ( configure_injector) , test_fn)
18671867 . await
@@ -1874,7 +1874,7 @@ impl Config {
18741874 test_fn : F ,
18751875 ) where
18761876 T1 : Future < Output = ( ) > + Send ,
1877- T2 : Future < Output = ( ) > + Send ,
1877+ T2 : Future < Output = Result < ( ) , CubeError > > + Send ,
18781878 I : FnOnce ( Arc < Injector > ) -> T1 ,
18791879 F : FnOnce ( CubeServices ) -> T2 ,
18801880 {
@@ -1900,8 +1900,10 @@ impl Config {
19001900
19011901 // Should be long enough even for CI.
19021902 let timeout = Duration :: from_secs ( 600 ) ;
1903- if let Err ( _) = timeout_at ( Instant :: now ( ) + timeout, test_fn ( services. clone ( ) ) ) . await {
1904- panic ! ( "Test timed out after {} seconds" , timeout. as_secs( ) ) ;
1903+ match timeout_at ( Instant :: now ( ) + timeout, test_fn ( services. clone ( ) ) ) . await {
1904+ Err ( _) => panic ! ( "Test timed out after {} seconds" , timeout. as_secs( ) ) ,
1905+ Ok ( Err ( e) ) => panic ! ( "Test failed: {}" , e. display_with_backtrace( ) ) ,
1906+ Ok ( Ok ( ( ) ) ) => { }
19051907 }
19061908
19071909 services. stop_processing_loops ( ) . await . unwrap ( ) ;
@@ -1924,7 +1926,7 @@ impl Config {
19241926 test_fn : F ,
19251927 ) where
19261928 T1 : Future < Output = ( ) > + Send ,
1927- T2 : Future < Output = ( ) > + Send ,
1929+ T2 : Future < Output = Result < ( ) , CubeError > > + Send ,
19281930 I : FnOnce ( Arc < Injector > ) -> T1 ,
19291931 F : FnOnce ( CubeServices ) -> T2 ,
19301932 {
@@ -1943,8 +1945,10 @@ impl Config {
19431945
19441946 // Should be long enough even for CI.
19451947 let timeout = Duration :: from_secs ( 600 ) ;
1946- if let Err ( _) = timeout_at ( Instant :: now ( ) + timeout, test_fn ( services. clone ( ) ) ) . await {
1947- panic ! ( "Test timed out after {} seconds" , timeout. as_secs( ) ) ;
1948+ match timeout_at ( Instant :: now ( ) + timeout, test_fn ( services. clone ( ) ) ) . await {
1949+ Err ( _) => panic ! ( "Test timed out after {} seconds" , timeout. as_secs( ) ) ,
1950+ Ok ( Err ( e) ) => panic ! ( "Test failed: {}" , e. display_with_backtrace( ) ) ,
1951+ Ok ( Ok ( ( ) ) ) => { }
19481952 }
19491953
19501954 services. stop_processing_loops ( ) . await . unwrap ( ) ;
@@ -1962,14 +1966,14 @@ impl Config {
19621966
19631967 pub async fn run_test < T > ( name : & str , test_fn : impl FnOnce ( CubeServices ) -> T )
19641968 where
1965- T : Future < Output = ( ) > + Send ,
1969+ T : Future < Output = Result < ( ) , CubeError > > + Send ,
19661970 {
19671971 Self :: test ( name) . start_test ( test_fn) . await ;
19681972 }
19691973
19701974 pub async fn run_migration_test < T > ( name : & str , test_fn : impl FnOnce ( CubeServices ) -> T )
19711975 where
1972- T : Future < Output = ( ) > + Send ,
1976+ T : Future < Output = Result < ( ) , CubeError > > + Send ,
19731977 {
19741978 Self :: migration_test ( name)
19751979 . start_migration_test ( test_fn)
0 commit comments