Skip to content

Commit c7f2c17

Browse files
committed
Fix various sporadic test failures
* Increase a `default-delay="1000"` for `GatewayInterfaceTests` to test the late reply scenario * Use a `ConcurrentHashMap` for `JdbcMessageStore.queryCache` to avoid a possible `ConcurrentModificationException`
1 parent a493c9c commit c7f2c17

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spring-integration-core/src/test/java/org/springframework/integration/gateway/GatewayInterfaceTests-context.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<int:header-enricher>
2626
<int:error-channel ref="errorChannel" overwrite="true"/>
2727
</int:header-enricher>
28-
<int:delayer id="delayer" default-delay="100"/>
28+
<int:delayer id="delayer" default-delay="1000"/>
2929
</int:chain>
3030

3131

spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcMessageStore.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,11 +22,11 @@
2222
import java.sql.Timestamp;
2323
import java.util.Arrays;
2424
import java.util.Collection;
25-
import java.util.HashMap;
2625
import java.util.Iterator;
2726
import java.util.List;
2827
import java.util.Map;
2928
import java.util.UUID;
29+
import java.util.concurrent.ConcurrentHashMap;
3030
import java.util.stream.Stream;
3131

3232
import javax.sql.DataSource;
@@ -171,7 +171,7 @@ public String getSql() {
171171

172172
private final String vendorName;
173173

174-
private final Map<Query, String> queryCache = new HashMap<>();
174+
private final Map<Query, String> queryCache = new ConcurrentHashMap<>();
175175

176176
private String region = "DEFAULT";
177177

0 commit comments

Comments
 (0)