Slava, what is the consequence/price of disabling compact footer? Although it
looks like it only happens for the integration tests, and never (at least we
have not observed this problem) in production.

This is the test (we use Spock):

class SessionsCacheITSpec extends IgniteCacheITSpec {
    @Inject
    @Subject
    IgniteCache<String, Session> sessionsCache

    @Inject
    SessionsRepository sessionsRepository

    def "verify on the start sessionsCache cache is empty"() {
        expect:
        sessionsCache.size() == 0
    }

    def "verify get on non existent session id returns null"() {
        setup:
        def sessionId = UUID.randomUUID().toString()

        when:
        def session = sessionsCache.get(sessionId)

        then:
        session == null
    }

    def "verify get on the existing session id session is loaded from db"()
{
        setup:
        ...        
        def session = new Session(...
        )
        sessionsRepository.save(session)

        when:
        def actualSession = sessionsCache.get(sessionId)

        then:
        actualSession == session
    }
}

where IgniteCacheITSpec is the following:

@SpringApplicationConfiguration
@IntegrationTest
@DirtiesContext
class IgniteCacheITSpec extends Specification {

    @Inject
    CacheEnvironment cacheEnvironment

    @Inject
    @Qualifier("client")
    Ignite igniteClient

    @Shared
    Ignite igniteServer

    @Configuration
    @ComponentScan([...])
    static class IgniteClientConfiguration {
    }

    def setupSpec() {
        Ignition.setClientMode(false)
        igniteServer = Ignition.start(new
ClassPathResource("META-INF/grid.xml").inputStream)
    }

    def cleanupSpec() {
        def grids = Ignition.allGrids()
        // stop all clients first
        grids.findAll { it.configuration().isClientMode() } forEach {
it.close() }
        igniteServer.close()
    }
}


where the igniteClient is defined as the spring bean in one of the
configuration class, like the following:

@Bean(name = "ignite", destroyMethod = "close")
    @Qualifier("client")
    public Ignite ignite() {
        Ignition.setClientMode(true);
        return Ignition.start(igniteConfiguration());
}

Probably that could due to usage of the @DirtiesContext, although just a
guess.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Reply via email to