Skip to content

Commit

Permalink
Fixed test (ignite-795).
Browse files Browse the repository at this point in the history
  • Loading branch information
sboikov committed Sep 8, 2015
1 parent d8cd7ba commit a96849d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Expand Up @@ -145,11 +145,15 @@ public void testMessageRecovery() throws Exception {
});

try {
boolean closed = false;

for (int i = 0; i < 30; i++) {
Thread.sleep(1000);

closeSessions();
closed |= closeSessions();
}

assertTrue(closed);
}
finally {
stop.set(true);
Expand All @@ -161,7 +165,7 @@ public void testMessageRecovery() throws Exception {
/**
* @throws Exception If failed.
*/
private void closeSessions() throws Exception {
private boolean closeSessions() throws Exception {
Ignite ignite = ignite(ThreadLocalRandom.current().nextInt(0, GRID_CNT));

log.info("Close sessions for: " + ignite.name());
Expand All @@ -170,14 +174,18 @@ private void closeSessions() throws Exception {

Map<UUID, GridCommunicationClient> clients = U.field(commSpi, "clients");

assertTrue(clients.size() > 0);
boolean closed = false;

for (GridCommunicationClient client : clients.values()) {
GridTcpNioCommunicationClient client0 = (GridTcpNioCommunicationClient)client;

GridNioSession ses = client0.session();

ses.close();

closed = true;
}

return closed;
}
}
Expand Up @@ -25,11 +25,6 @@
*
*/
public class IgniteCacheTxMessageRecoveryTest extends IgniteCacheMessageRecoveryAbstractTest {
/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
fail("https://issues.apache.org/jira/browse/IGNITE-795");
}

/** {@inheritDoc} */
@Override protected CacheAtomicityMode atomicityMode() {
return TRANSACTIONAL;
Expand Down

0 comments on commit a96849d

Please sign in to comment.