Skip to content

Commit

Permalink
test: prevent race condition failure on it-tests (#2168)
Browse files Browse the repository at this point in the history
## Proposed change

<!-- Please include a summary of the changes and the related issue.
Please also include relevant motivation and context. List any
dependencies that is required for this change. -->

## Related issues

- 🐛 Fixes #(issue)
- 🚀 Feature #(issue)

<!-- Please make sure to follow the contributing guidelines on
https://github.com/amadeus-digital/Otter/blob/main/CONTRIBUTING.md -->
  • Loading branch information
fpaul-1A authored Sep 13, 2024
2 parents dcdb453 + bc0cf55 commit ee7f835
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/@o3r/test-helpers/src/utilities/locker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
}
}

0 comments on commit ee7f835

Please sign in to comment.