Skip to content

Commit 5adcc50

Browse files
committed
Add error message as to why the test cannot be run.
1 parent bd46a88 commit 5adcc50

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ public void dumpLocks() {
6161

6262
@Test
6363
public void assignReleaseThread() {
64+
if (AffinityLock.RESERVED_AFFINITY == 0) {
65+
System.out.println("Cannot run affinity test as no threads gave been reserved.");
66+
System.out.println("Use isocpus= in grub.conf or use -D" + AffinityLock.AFFINITY_RESERVED + "={hex mask}");
67+
return;
68+
}
69+
6470
assertEquals(AffinityLock.BASE_AFFINITY, AffinitySupport.getAffinity());
6571
AffinityLock al = AffinityLock.acquireLock();
6672
assertEquals(1, Long.bitCount(AffinitySupport.getAffinity()));

0 commit comments

Comments
 (0)