Skip to content

Commit 0dcc818

Browse files
committed
fix(test): move ConditionallyStopTest init to beforeContext()
Genesis timestamp and node port must be set before Spring context creation, otherwise DposSlot calculates negative slot values.
1 parent d6f6f06 commit 0dcc818

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

framework/src/test/java/org/tron/core/services/stop/ConditionallyStopTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ public abstract class ConditionallyStopTest extends BaseMethodTest {
5454
private Map<String, String> witnesses;
5555

5656
@Override
57-
protected void afterInit() {
57+
protected void beforeContext() {
5858
Args.getInstance().setNodeListenPort(10000 + port.incrementAndGet());
5959
Args.getInstance().genesisBlock.setTimestamp(Long.toString(time));
6060
initParameter(Args.getInstance());
61+
}
6162

63+
@Override
64+
protected void afterInit() {
6265
dposSlot = context.getBean(DposSlot.class);
6366
ConsensusService consensusService = context.getBean(ConsensusService.class);
6467
consensusService.start();

0 commit comments

Comments
 (0)