From cbfd845ce50469d18df92ee415302734b3f8eaa7 Mon Sep 17 00:00:00 2001 From: Anton Nahsatyrev Date: Thu, 22 Dec 2016 15:18:20 +0300 Subject: [PATCH] Fix sync stopping in test --- .../test/java/org/ethereum/longrun/SyncWithLoadTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ethereumj-core/src/test/java/org/ethereum/longrun/SyncWithLoadTest.java b/ethereumj-core/src/test/java/org/ethereum/longrun/SyncWithLoadTest.java index 96638cf2ef..12921394f0 100644 --- a/ethereumj-core/src/test/java/org/ethereum/longrun/SyncWithLoadTest.java +++ b/ethereumj-core/src/test/java/org/ethereum/longrun/SyncWithLoadTest.java @@ -16,6 +16,7 @@ import org.ethereum.facade.EthereumFactory; import org.ethereum.listener.EthereumListener; import org.ethereum.listener.EthereumListenerAdapter; +import org.ethereum.sync.SyncManager; import org.ethereum.util.FastByteComparisons; import org.ethereum.vm.program.invoke.ProgramInvokeFactory; import org.junit.Ignore; @@ -128,6 +129,9 @@ static class RegularNode extends BasicNode { @Autowired ProgramInvokeFactory programInvokeFactory; + @Autowired + SyncManager syncManager; + /** * The main EthereumJ callback. */ @@ -203,10 +207,8 @@ public void run() { sleep(i * 60_000); // Stop syncing - config.setSyncEnabled(false); - config.setDiscoveryEnabled(false); - ethereum.getChannelManager().close(); syncPool.close(); + syncManager.close(); } catch (Exception ex) { testLogger.error("Error occurred during run: ", ex); }