Skip to content

Commit

Permalink
Issue #12315 fix flakey session AsyncTest (#12316)
Browse files Browse the repository at this point in the history
  • Loading branch information
janbartel authored Sep 26, 2024
1 parent 8aa9c8b commit ba0ba99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void testSessionWithAsyncDispatch() throws Exception

DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory();
cacheFactory.setEvictionPolicy(SessionCache.EVICT_ON_SESSION_EXIT);
cacheFactory.setFlushOnResponseCommit(true);
SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory();
SessionTestSupport server = new SessionTestSupport(0, -1, -1, cacheFactory, storeFactory);

Expand Down Expand Up @@ -106,6 +107,7 @@ public void testSessionWithAsyncComplete() throws Exception

DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory();
cacheFactory.setEvictionPolicy(SessionCache.EVICT_ON_SESSION_EXIT);
cacheFactory.setFlushOnResponseCommit(true);
SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory();
SessionTestSupport server = new SessionTestSupport(0, -1, -1, cacheFactory, storeFactory);

Expand Down Expand Up @@ -156,6 +158,7 @@ public void testSessionWithCrossContextAsync() throws Exception

DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory();
cacheFactory.setEvictionPolicy(SessionCache.EVICT_ON_SESSION_EXIT);
cacheFactory.setFlushOnResponseCommit(true);
SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory();
SessionTestSupport server = new SessionTestSupport(0, -1, -1, cacheFactory, storeFactory);

Expand Down Expand Up @@ -202,9 +205,9 @@ public void testSessionWithCrossContextAsync() throws Exception
@Test
public void testSessionCreatedBeforeDispatch() throws Exception
{

DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory();
cacheFactory.setEvictionPolicy(SessionCache.EVICT_ON_SESSION_EXIT);
cacheFactory.setFlushOnResponseCommit(true);
SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory();
SessionTestSupport server = new SessionTestSupport(0, -1, -1, cacheFactory, storeFactory);

Expand Down Expand Up @@ -257,6 +260,7 @@ public void testSessionWithCrossContextAsyncComplete() throws Exception

DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory();
cacheFactory.setEvictionPolicy(SessionCache.EVICT_ON_SESSION_EXIT);
cacheFactory.setFlushOnResponseCommit(true);
SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory();
SessionTestSupport server = new SessionTestSupport(0, -1, -1, cacheFactory, storeFactory);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void testSessionWithAsyncDispatch() throws Exception

DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory();
cacheFactory.setEvictionPolicy(SessionCache.EVICT_ON_SESSION_EXIT);
cacheFactory.setFlushOnResponseCommit(true);
SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory();
SessionTestSupport server = new SessionTestSupport(0, -1, -1, cacheFactory, storeFactory);

Expand Down Expand Up @@ -102,9 +103,9 @@ public void testSessionWithAsyncDispatch() throws Exception
public void testSessionWithAsyncComplete() throws Exception
{
// Test async write, which creates a session and completes outside of a dispatch

DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory();
cacheFactory.setEvictionPolicy(SessionCache.EVICT_ON_SESSION_EXIT);
cacheFactory.setFlushOnResponseCommit(true);
SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory();
SessionTestSupport server = new SessionTestSupport(0, -1, -1, cacheFactory, storeFactory);

Expand Down Expand Up @@ -153,6 +154,7 @@ public void testSessionWithCrossContextAsync() throws Exception

DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory();
cacheFactory.setEvictionPolicy(SessionCache.EVICT_ON_SESSION_EXIT);
cacheFactory.setFlushOnResponseCommit(true);
SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory();
SessionTestSupport server = new SessionTestSupport(0, -1, -1, cacheFactory, storeFactory);

Expand Down Expand Up @@ -198,9 +200,9 @@ public void testSessionWithCrossContextAsync() throws Exception
@Test
public void testSessionCreatedBeforeDispatch() throws Exception
{

DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory();
cacheFactory.setEvictionPolicy(SessionCache.EVICT_ON_SESSION_EXIT);
cacheFactory.setFlushOnResponseCommit(true);
SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory();
SessionTestSupport server = new SessionTestSupport(0, -1, -1, cacheFactory, storeFactory);

Expand Down Expand Up @@ -252,6 +254,7 @@ public void testSessionWithCrossContextAsyncComplete() throws Exception

DefaultSessionCacheFactory cacheFactory = new DefaultSessionCacheFactory();
cacheFactory.setEvictionPolicy(SessionCache.EVICT_ON_SESSION_EXIT);
cacheFactory.setFlushOnResponseCommit(true);
SessionDataStoreFactory storeFactory = new TestSessionDataStoreFactory();
SessionTestSupport server = new SessionTestSupport(0, -1, -1, cacheFactory, storeFactory);

Expand Down

0 comments on commit ba0ba99

Please sign in to comment.