From bc0cf55449e92c63511f6a34c386f48a9af7e7eb Mon Sep 17 00:00:00 2001 From: Florian PAUL Date: Fri, 13 Sep 2024 15:42:39 +0200 Subject: [PATCH] test: prevent race condition failure on it-tests --- packages/@o3r/test-helpers/src/utilities/locker.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/@o3r/test-helpers/src/utilities/locker.ts b/packages/@o3r/test-helpers/src/utilities/locker.ts index 262662dc92..130caaf284 100644 --- a/packages/@o3r/test-helpers/src/utilities/locker.ts +++ b/packages/@o3r/test-helpers/src/utilities/locker.ts @@ -100,8 +100,12 @@ export class Locker { resolve(); } }; - watcher = watch(this.options.lockFilePath, {persistent: false}, check); - watcher.on('error', check); + try { + watcher = watch(this.options.lockFilePath, {persistent: false}, check); + watcher.on('error', check); + } catch { + check(); + } }); } }