File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ fn get_watcher(
3131) -> Arc < Mutex < Debouncer < RecommendedWatcher > > > {
3232 let config = Config :: default ( )
3333 . with_batch_mode ( true )
34- . with_timeout ( Duration :: from_secs ( 2 ) ) ;
34+ . with_timeout ( Duration :: from_secs ( 1 ) ) ;
3535 Arc :: new ( Mutex :: new ( new_debouncer_opt ( config, tx) . unwrap ( ) ) )
3636}
3737impl CodegenDatabase {
Original file line number Diff line number Diff line change @@ -36,12 +36,15 @@ fn test_basic(dirname: &str) -> Result<(), Error> {
3636 start_point = "/tmp"
3737) ) ]
3838fn test_add_file ( dirname : & str ) -> Result < ( ) , Error > {
39+ use std:: thread:: sleep;
40+
3941 let dir = PathBuf :: from ( dirname) ;
4042 let mut codebase = Codebase :: new ( dir. clone ( ) ) ;
4143 let new_file = dir. join ( "test2.py" ) ;
4244 std:: fs:: write ( & new_file, "import codegen_sdk_pink" ) . unwrap ( ) ;
4345 log:: info!( "Added file at {}" , new_file. display( ) ) ;
4446 assert_eq ! ( codebase. files( ) . len( ) , 1 ) ;
47+ sleep ( Duration :: from_secs ( 2 ) ) ;
4548 log:: info!( "Checking update" ) ;
4649 codebase. check_update ( ) . unwrap ( ) ;
4750 log:: info!( "Checking update done" ) ;
@@ -72,6 +75,7 @@ fn test_remove_file(dirname: &str) -> Result<(), Error> {
7275 assert_eq ! ( codebase. files( ) . len( ) , 1 ) ;
7376 std:: fs:: remove_file ( new_file) . unwrap ( ) ;
7477 log:: info!( "Removed file" ) ;
78+ sleep ( Duration :: from_secs ( 2 ) ) ;
7579 log:: info!( "Checking update" ) ;
7680 codebase. check_update ( ) . unwrap ( ) ;
7781 log:: info!( "Checking update done" ) ;
You can’t perform that action at this time.
0 commit comments