Skip to content

Commit

Permalink
IGNITE-23994 Remove setForceServerMode from GridCacheClientModesAbstr…
Browse files Browse the repository at this point in the history
…actSelfTest (#11743)
  • Loading branch information
nizhikov authored Dec 16, 2024
1 parent 85dcd9e commit a1d17d1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.apache.ignite.internal.processors.cache.GridCacheAbstractSelfTest;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.G;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.junit.Test;

import static org.apache.ignite.cache.CacheMode.PARTITIONED;
Expand Down Expand Up @@ -71,14 +70,12 @@ public abstract class GridCacheClientModesAbstractSelfTest extends GridCacheAbst

int cnt = gridCnt.incrementAndGet();

if ((cnt == gridCount() && isClientStartedLast()) || (cnt == 1 && !isClientStartedLast())) {
if (cnt == gridCount()) {
cfg.setClientMode(true);

nearOnlyIgniteInstanceName = igniteInstanceName;
}

((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(true);

return cfg;
}

Expand All @@ -105,13 +102,6 @@ public abstract class GridCacheClientModesAbstractSelfTest extends GridCacheAbst
return PARTITIONED;
}

/**
* @return boolean {@code True} if client's grid must be started last, {@code false} if it must be started first.
*/
protected boolean isClientStartedLast() {
return false;
}

/**
* @throws Exception If failed.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

import org.apache.ignite.cache.CacheAtomicityMode;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.configuration.NearCacheConfiguration;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;

import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheMode.REPLICATED;
Expand All @@ -31,20 +29,6 @@
*/
@SuppressWarnings("RedundantMethodOverride")
public abstract class GridCacheClientModesTcpClientDiscoveryAbstractTest extends GridCacheClientModesAbstractSelfTest {
/** {@inheritDoc} */
@Override protected boolean isClientStartedLast() {
return true;
}

/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

((TcpDiscoverySpi)cfg.getDiscoverySpi()).setForceServerMode(false);

return cfg;
}

/** */
public static class CaseNearReplicatedAtomic extends GridCacheClientModesTcpClientDiscoveryAbstractTest {
/** {@inheritDoc} */
Expand Down

0 comments on commit a1d17d1

Please sign in to comment.