Skip to content

Commit cdc5ad6

Browse files
authored
Test reduce flaky tests (#750)
Signed-off-by: Valentin Delaye <jonesbusy@users.noreply.github.com>
1 parent 203e500 commit cdc5ad6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/test/java/land/oras/TestUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static void dumpMetrics(MeterRegistry meterRegistry) {
5757
* @param homeDir the home directory where the .config/containers/registries.conf file will be created
5858
* @param content the content of the registries.conf file
5959
*/
60-
public static void createRegistriesConfFile(Path homeDir, String content) {
60+
public static synchronized void createRegistriesConfFile(Path homeDir, String content) {
6161
try {
6262
Files.createDirectory(homeDir.resolve(".config"));
6363
Files.createDirectory(homeDir.resolve(".config").resolve("containers"));
@@ -73,7 +73,7 @@ public static void createRegistriesConfFile(Path homeDir, String content) {
7373
* @param action the action to execute with the HOME environment variable set
7474
* @throws Exception if any exception occurs during the execution of the action
7575
*/
76-
public static void withHome(Path homeDir, Runnable action) throws Exception {
76+
public static synchronized void withHome(Path homeDir, Runnable action) throws Exception {
7777
new EnvironmentVariables()
7878
.set("HOME", homeDir.toAbsolutePath().toString())
7979
.execute(() -> {

0 commit comments

Comments
 (0)