Skip to content

Commit 096317a

Browse files
fix(ci): fix lock compete in RevokingDbWithCacheNewValueTest
1 parent 80f04d8 commit 096317a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

framework/src/test/java/org/tron/core/db2/RevokingDbWithCacheNewValueTest.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.util.stream.Collectors;
88
import lombok.extern.slf4j.Slf4j;
99
import org.apache.commons.lang3.ArrayUtils;
10+
import org.apache.commons.lang3.RandomStringUtils;
1011
import org.junit.After;
1112
import org.junit.Assert;
1213
import org.junit.Before;
@@ -34,9 +35,12 @@ public class RevokingDbWithCacheNewValueTest {
3435
private Application appT;
3536
private TestRevokingTronStore tronDatabase;
3637

38+
private String databasePath = "";
39+
3740
@Before
3841
public void init() {
39-
Args.setParam(new String[]{"-d", "output_revokingStore_test"},
42+
databasePath = "output_revokingStore_test_" + RandomStringUtils.randomAlphanumeric(10);
43+
Args.setParam(new String[]{"-d", databasePath},
4044
Constant.TEST_CONF);
4145
context = new TronApplicationContext(DefaultConfig.class);
4246
appT = ApplicationFactory.create(context);
@@ -47,7 +51,7 @@ public void removeDb() {
4751
Args.clearParam();
4852
context.destroy();
4953
tronDatabase.close();
50-
FileUtil.deleteDir(new File("output_revokingStore_test"));
54+
FileUtil.deleteDir(new File(databasePath));
5155
}
5256

5357
@Test
@@ -384,7 +388,8 @@ public synchronized void testGetKeysNextWithSameKey() {
384388
public synchronized void testGetKeysNextWithSameKeyOrderCheck() {
385389
revokingDatabase = context.getBean(SnapshotManager.class);
386390
revokingDatabase.enable();
387-
tronDatabase = new TestRevokingTronStore("testSnapshotManager-testGetKeysNextWithSameKey");
391+
tronDatabase = new TestRevokingTronStore(
392+
"testSnapshotManager-testGetKeysNextWithSameKeyOrderCheck");
388393
revokingDatabase.add(tronDatabase.getRevokingDB());
389394
while (revokingDatabase.size() != 0) {
390395
revokingDatabase.pop();

0 commit comments

Comments
 (0)