Commit d07caef
test: fix flaky SpringAnnotationCompatibilityTest
The test asserted that the first ApolloConfigChangeEvent received by the
ApplicationListener probe is for namespace 'application'. However, config
change listeners are notified asynchronously on a shared thread pool
(AbstractConfig#notifyAsync), so events from different namespaces may
arrive in any order, occasionally failing CI with:
expected:<application[]> but was:<application[.yaml]>
Replace the order-sensitive FIFO assertion with an order-independent
check that all expected namespaces are eventually observed, matching the
approach already used in ApolloSpringBootCompatibilityTest.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent a9a6edc commit d07caef
2 files changed
Lines changed: 14 additions & 9 deletions
File tree
- apollo-compat-tests/apollo-spring-compat-it/src/test/java/com/ctrip/framework/apollo/compat/spring
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
127 | 132 | | |
128 | 133 | | |
129 | 134 | | |
| |||
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
0 commit comments