Skip to content

Commit

Permalink
fixed rolling bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Austin committed Jan 27, 2016
1 parent 1d136ff commit ad68505
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Expand Up @@ -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
Expand Down
Expand Up @@ -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";

Expand Down
Expand Up @@ -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";

Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand All @@ -216,7 +215,6 @@ public void testAppendAndReadWithRolling() throws IOException {
}
}


@Test
public void testAppendAndReadWithRolling2() throws IOException, InterruptedException {
final File dir = getTmpDir();
Expand Down Expand Up @@ -375,7 +373,7 @@ public void testReadAtIndex() throws Exception {
}
}

// @Ignore("long running test")
@Ignore("long running test")
@Test
public void testReadAtIndex4MB() throws Exception {

Expand Down

0 comments on commit ad68505

Please sign in to comment.