Skip to content

Commit

Permalink
IGNITE-7823 Test fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
xtern committed Jul 23, 2018
1 parent 8882628 commit 0deb80a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
Expand Up @@ -781,7 +781,7 @@ public static <T> String toString(Class<T> cls, T obj) {
* @param <T> Type of the object.
* @param cls Declaration class of the object. Note that this should not be a runtime class.
* @param obj Object to get a string presentation for.
* @param parent String representation of parent.bkb
* @param parent String representation of parent.
* @return String presentation of the given object.
*/
public static <T> String toString(Class<T> cls, T obj, String parent) {
Expand Down
Expand Up @@ -21,7 +21,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteException;
import org.apache.ignite.IgniteSet;
import org.apache.ignite.IgniteQueue;
import org.apache.ignite.configuration.CollectionConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.IgniteInternalFuture;
Expand Down Expand Up @@ -59,25 +59,6 @@ public class IgniteDataStructureWithJobTest extends GridCommonAbstractTest {
* @throws Exception If failed.
*/
public void testJobWithRestart() throws Exception {
// Non-collocated IgniteSet uses cache iterator, which can fail
// on unstable topology when the job is logged.
fail("https://issues.apache.org/jira/browse/IGNITE-1666");

checkDatastructureJobWithRestart(false);
}

/**
* @throws Exception If failed.
*/
public void testJobWithRestartCollocated() throws Exception {
checkDatastructureJobWithRestart(true);
}

/**
* @param collocated Collocated flag.
* @throws Exception If failed.
*/
private void checkDatastructureJobWithRestart(boolean collocated) throws Exception {
Ignite ignite = startGrid(0);

final AtomicBoolean stop = new AtomicBoolean();
Expand All @@ -101,13 +82,13 @@ private void checkDatastructureJobWithRestart(boolean collocated) throws Excepti

while (System.currentTimeMillis() < endTime) {
try {
ignite.compute().broadcast(new IgniteClosure<IgniteSet, Integer>() {
@Override public Integer apply(IgniteSet set) {
assertNotNull(set);
ignite.compute().broadcast(new IgniteClosure<IgniteQueue, Integer>() {
@Override public Integer apply(IgniteQueue queue) {
assertNotNull(queue);

return 1;
}
}, ignite.set("set", new CollectionConfiguration().setCollocated(collocated)));
}, ignite.queue("queue", 0, new CollectionConfiguration()));
}
catch (IgniteException e) {
if (X.hasCause(e, AssertionError.class))
Expand Down

0 comments on commit 0deb80a

Please sign in to comment.