From e0fc4078fc5c8a76199574e7621f9ea95909d414 Mon Sep 17 00:00:00 2001 From: flaymes Date: Thu, 4 Jul 2024 18:43:17 +0800 Subject: [PATCH 1/3] (typo) fix some typo --- .../com/alipay/sofa/jraft/storage/impl/BaseLogStorageTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/BaseLogStorageTest.java b/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/BaseLogStorageTest.java index 7152d56d6..5eff358b0 100644 --- a/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/BaseLogStorageTest.java +++ b/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/BaseLogStorageTest.java @@ -187,7 +187,7 @@ public void testTruncatePrefix() throws Exception { } @Test - public void testAppendMantyLargeEntries() { + public void testAppendManyLargeEntries() { final long start = Utils.monotonicMs(); final int totalLogs = 100000; final int logSize = 16 * 1024; From 7776a75d577f0a54f0116f56df4bfe48e556fbed Mon Sep 17 00:00:00 2001 From: flaymes Date: Thu, 4 Jul 2024 19:10:54 +0800 Subject: [PATCH 2/3] (chore) adjust the test code order and method of obtaining term id --- .../sofa/jraft/storage/impl/BaseLogStorageTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/BaseLogStorageTest.java b/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/BaseLogStorageTest.java index 5eff358b0..60b8771a3 100644 --- a/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/BaseLogStorageTest.java +++ b/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/BaseLogStorageTest.java @@ -149,10 +149,10 @@ public void testAddManyEntries() { assertEquals(0, this.logStorage.getFirstLogIndex()); assertEquals(9, this.logStorage.getLastLogIndex()); for (int i = 0; i < 10; i++) { - assertEquals(i, this.logStorage.getTerm(i)); - final LogEntry entry = this.logStorage.getEntry(i); - assertNotNull(entry); - assertEquals(entries.get(i), entry); + final LogEntry logEntry = this.logStorage.getEntry(i); + assertNotNull(logEntry); + assertEquals(entries.get(i), logEntry); + assertEquals(i, logEntry.getId().getTerm()); } } From 3b56a76a937b91973539da9da1f2d45e82169f5a Mon Sep 17 00:00:00 2001 From: flaymes Date: Thu, 4 Jul 2024 19:56:47 +0800 Subject: [PATCH 3/3] fix typo --- .../java/com/alipay/sofa/jraft/storage/impl/LogManagerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/LogManagerTest.java b/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/LogManagerTest.java index e58c8dc88..d2d5d3290 100644 --- a/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/LogManagerTest.java +++ b/jraft-core/src/test/java/com/alipay/sofa/jraft/storage/impl/LogManagerTest.java @@ -202,7 +202,7 @@ public void run(final Status status) { } @Test - public void testAppendEntresConflicts() throws Exception { + public void testAppendEntriesConflicts() throws Exception { //Append 0-10 List mockEntries = TestUtils.mockEntries(10); for (int i = 0; i < 10; i++) {