File tree 2 files changed +7
-1
lines changed
main/java/org/tron/common/backup/socket
test/java/org/tron/common/backup
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,6 @@ public void initChannel(NioDatagramChannel ch)
95
95
public void close () {
96
96
logger .info ("Closing backup server..." );
97
97
shutdown = true ;
98
- ExecutorServiceManager .shutdownAndAwaitTermination (executor , name );
99
98
backupManager .stop ();
100
99
if (channel != null ) {
101
100
try {
@@ -104,6 +103,7 @@ public void close() {
104
103
logger .warn ("Closing backup server failed." , e );
105
104
}
106
105
}
106
+ ExecutorServiceManager .shutdownAndAwaitTermination (executor , name );
107
107
logger .info ("Backup server closed." );
108
108
}
109
109
}
Original file line number Diff line number Diff line change 7
7
import org .junit .Rule ;
8
8
import org .junit .Test ;
9
9
import org .junit .rules .TemporaryFolder ;
10
+ import org .junit .rules .Timeout ;
10
11
import org .tron .common .backup .socket .BackupServer ;
11
12
import org .tron .common .parameter .CommonParameter ;
12
13
import org .tron .core .Constant ;
@@ -17,6 +18,9 @@ public class BackupServerTest {
17
18
18
19
@ Rule
19
20
public TemporaryFolder temporaryFolder = new TemporaryFolder ();
21
+
22
+ @ Rule
23
+ public Timeout globalTimeout = Timeout .seconds (60 );
20
24
private BackupServer backupServer ;
21
25
22
26
@ Before
@@ -40,5 +44,7 @@ public void tearDown() {
40
44
@ Test
41
45
public void test () throws InterruptedException {
42
46
backupServer .initServer ();
47
+ // wait for the server to start
48
+ Thread .sleep (1000 );
43
49
}
44
50
}
You can’t perform that action at this time.
0 commit comments