File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -362,9 +362,14 @@ impl DevEngine {
362362 . map_err_to_unhandleable ( )
363363 . context ( "DevEngine: failed to send Close message to coordinator - coordinator may have already terminated" ) ?;
364364
365- // Close the bundler (calls `closeBundle` plugin hook)
366- let mut bundler = self . bundler . lock ( ) . await ;
367- bundler. close ( ) . await ?;
365+ // Close the bundler (calls `closeBundle` plugin hook).
366+ // The bundler lock MUST be released before waiting for the coordinator below.
367+ // Otherwise we'd deadlock: the coordinator's Close handler waits for any running
368+ // bundling task to finish, and that task may need to acquire the bundler lock.
369+ {
370+ let mut bundler = self . bundler . lock ( ) . await ;
371+ bundler. close ( ) . await ?;
372+ }
368373
369374 // Wait for coordinator to close (coordinator handles watcher cleanup)
370375 let coordinator_state = self . coordinator_state . lock ( ) . await ;
Original file line number Diff line number Diff line change @@ -366,7 +366,10 @@ impl IntegrationTest {
366366 // Explicitly close the dev engine to shut down the background coordinator task.
367367 // Without this, the coordinator task would persist across tests under the shared runtime.
368368 if let Err ( err) = dev_engine. close ( ) . await {
369- panic ! ( "Failed to close dev_engine for integration test `{debug_title}`: {err:#?}" ) ;
369+ panic ! (
370+ "Failed to close dev_engine for integration test in `{}` (title: `{debug_title}`): {err:#?}" ,
371+ test_folder_path. display( )
372+ ) ;
370373 }
371374 }
372375
You can’t perform that action at this time.
0 commit comments