Skip to content

Commit

Permalink
SCB-168 connected to alpha on start
Browse files Browse the repository at this point in the history
Signed-off-by: seanyinx <sean.yin@huawei.com>
  • Loading branch information
seanyinx authored and WillemJiang committed Jan 10, 2018
1 parent 1e7ff02 commit 367b1cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void tearDown() throws Exception {
repository.deleteAll();
}

@Test
@Test(timeout = 5000)
public void updatesTxStateToAlpha() throws Exception {
ResponseEntity<String> entity = restTemplate.getForEntity("/greet?name={name}",
String.class,
Expand Down Expand Up @@ -129,7 +129,7 @@ public void updatesTxStateToAlpha() throws Exception {
assertThat(compensatedMessages.isEmpty(), is(true));
}

@Test
@Test(timeout = 5000)
public void compensatesFailedGlobalTransaction() throws Exception {
ResponseEntity<String> entity = restTemplate.getForEntity("/greet?name={name}",
String.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ MessageSender grpcMessageSender(
serviceConfig,
handler);

Runtime.getRuntime().addShutdownHook(new Thread(sender::close));
sender.onConnected();
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
sender.onDisconnected();
sender.close();
}));

return sender;
}
Expand Down

0 comments on commit 367b1cc

Please sign in to comment.