diff --git a/src/main/java/net/openhft/chronicle/queue/impl/single/SingleChronicleQueueStore.java b/src/main/java/net/openhft/chronicle/queue/impl/single/SingleChronicleQueueStore.java index f77466f4c2..8138880bee 100755 --- a/src/main/java/net/openhft/chronicle/queue/impl/single/SingleChronicleQueueStore.java +++ b/src/main/java/net/openhft/chronicle/queue/impl/single/SingleChronicleQueueStore.java @@ -202,7 +202,9 @@ public void install(long length, boolean created, long cycle, @NotNull @Override public MappedBytes mappedBytes() { - return new MappedBytes(mappedFile);//.withSizes(this.chunkSize, this.overlapSize); + final MappedBytes mappedBytes = new MappedBytes(mappedFile); + mappedBytes.writePosition(writePosition()); + return mappedBytes; } @Override diff --git a/src/test/java/net/openhft/chronicle/queue/ChronicleQueueTwoThreads.java b/src/test/java/net/openhft/chronicle/queue/ChronicleQueueTwoThreads.java index 60a2722f7d..6f08fd2ef1 100644 --- a/src/test/java/net/openhft/chronicle/queue/ChronicleQueueTwoThreads.java +++ b/src/test/java/net/openhft/chronicle/queue/ChronicleQueueTwoThreads.java @@ -36,7 +36,7 @@ public class ChronicleQueueTwoThreads extends ChronicleQueueTestBase { private static final int BLOCK_SIZE = 256 << 20; private static final long INTERVAL_US = 10; - @Test(timeout = 5000) + @Test(timeout = 2000) public void testUnbuffered() throws IOException, InterruptedException { String path = getTmpDir() + "/deleteme.q"; diff --git a/src/test/java/net/openhft/chronicle/queue/ThreadedQueueTest.java b/src/test/java/net/openhft/chronicle/queue/ThreadedQueueTest.java index efbc1855dd..fcfdbf0c87 100644 --- a/src/test/java/net/openhft/chronicle/queue/ThreadedQueueTest.java +++ b/src/test/java/net/openhft/chronicle/queue/ThreadedQueueTest.java @@ -19,8 +19,8 @@ public class ThreadedQueueTest { public static final int REQUIRED_COUNT = 10; private static final int BLOCK_SIZE = 256 << 20; - @Test(timeout = 500000) - public void testName() throws Exception { + @Test(timeout = 1000) + public void testMultipleThreads() throws Exception { final String path = ChronicleQueueTestBase.getTmpDir() + "/deleteme.q"; diff --git a/src/test/java/net/openhft/chronicle/queue/impl/single/SingleChronicleQueueTest.java b/src/test/java/net/openhft/chronicle/queue/impl/single/SingleChronicleQueueTest.java index 911c8f4f59..14f0c9984f 100755 --- a/src/test/java/net/openhft/chronicle/queue/impl/single/SingleChronicleQueueTest.java +++ b/src/test/java/net/openhft/chronicle/queue/impl/single/SingleChronicleQueueTest.java @@ -21,6 +21,7 @@ import net.openhft.chronicle.wire.WireType; import org.jetbrains.annotations.NotNull; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -191,7 +192,7 @@ public void testReadAndAppend() throws IOException { @Test - public void testAppendAndReadWithRolling() throws IOException { + public void testAppendAndReadWithRolling() throws IOException, InterruptedException { final ChronicleQueue queue = new SingleChronicleQueueBuilder(getTmpDir()) .wireType(this.wireType) @@ -206,8 +207,6 @@ public void testAppendAndReadWithRolling() throws IOException { appender.writeDocument(w -> w.write(TestKey.test).int32(n)); } - System.out.println(""); - final ExcerptTailer tailer = queue.createTailer().toStart(); for (int i = 0; i < 5; i++) { final int n = i; @@ -216,7 +215,6 @@ public void testAppendAndReadWithRolling() throws IOException { } } - @Test public void testAppendAndReadWithRolling2() throws IOException, InterruptedException { final File dir = getTmpDir(); @@ -375,7 +373,7 @@ public void testReadAtIndex() throws Exception { } } - // @Ignore("long running test") + @Ignore("long running test") @Test public void testReadAtIndex4MB() throws Exception {