diff --git a/library_manager.module b/library_manager.module
index 77237c453a7ad22094fce5a6bc97a7707ea71932..07ee69ad3c8c32cd7f98bbb59b8e953bbb88e797 100644
--- a/library_manager.module
+++ b/library_manager.module
@@ -84,7 +84,8 @@ function library_manager_build_libraries() {
 
       $library_path = $libraries_path . '/' . $definition->id();
       if (file_exists($library_path)) {
-        file_unmanaged_delete_recursive($library_path);
+        // The files can be removed in other thread when tests are running.
+        @file_unmanaged_delete_recursive($library_path);
       }
 
       $library_info = [];