Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import net.openhft.affinity.impl.Utilities;
import net.openhft.affinity.impl.VanillaCpuLayout;
import net.openhft.affinity.testimpl.TestFileLockBasedLockChecker;
import org.hamcrest.MatcherAssert;
import org.junit.Test;
import org.slf4j.Logger;
Expand All @@ -28,6 +27,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -43,7 +43,6 @@
public class AffinityLockTest extends BaseAffinityTest {
private static final Logger logger = LoggerFactory.getLogger(AffinityLockTest.class);

private final TestFileLockBasedLockChecker lockChecker = new TestFileLockBasedLockChecker();

@Test
public void dumpLocksI7() throws IOException {
Expand Down Expand Up @@ -254,11 +253,12 @@ public void lockFilesShouldBeRemovedOnRelease() {
}
final AffinityLock lock = AffinityLock.acquireLock();

assertTrue(Files.exists(Paths.get(lockChecker.doToFile(lock.cpuId()).getAbsolutePath())));
Path lockFile = Paths.get(System.getProperty("java.io.tmpdir"), "cpu-" + lock.cpuId() + ".lock");
assertTrue(Files.exists(lockFile));

lock.release();

assertFalse(Files.exists(Paths.get(lockChecker.doToFile(lock.cpuId()).getAbsolutePath())));
assertFalse(Files.exists(lockFile));
}

@Test
Expand Down