Skip to content

Commit 6f2b7b8

Browse files
committed
Fix a test which only runs on Linux.
1 parent 1d82287 commit 6f2b7b8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/test/java/vanilla/java/affinity/AffinityLockTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.junit.Test;
2020
import vanilla.java.affinity.impl.VanillaCpuLayout;
2121

22+
import java.io.File;
2223
import java.io.IOException;
2324
import java.util.ArrayList;
2425
import java.util.List;
@@ -115,6 +116,9 @@ public void assignReleaseThread() throws IOException {
115116
System.out.println("Cannot run affinity test as no threads gave been reserved.");
116117
System.out.println("Use isolcpus= in grub.conf or use -D" + AffinityLock.AFFINITY_RESERVED + "={hex mask}");
117118
return;
119+
} else if (!new File("/proc/cpuinfo").exists()) {
120+
System.out.println("Cannot run affinity test as this system doesn't have a /proc/cpuinfo file");
121+
return;
118122
}
119123
AffinityLock.cpuLayout(VanillaCpuLayout.fromCpuInfo());
120124

0 commit comments

Comments
 (0)