Commit 4ed43a6
fix: 修复 data-fast 测试跨类数据泄漏导致的 CI 外键约束失败
UserRepositoryTest 保存 user→profile→demo 外键链数据后从不清理,
当测试类执行顺序使 UserRepositoryTest 先于 DemoRepositoryTest/
JdbcQueryTest 运行时(执行顺序随 JDK 构建不同而变化,本地与 CI
不一致),后者的 deleteAll 会因 PROFILE 表残留行触发外键约束冲突,
导致 CI 间歇性失败。为 UserRepositoryTest 增加 @BeforeEach/@AfterEach
按外键顺序(user→profile→demo)清理,使其完全自包含。
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 2264954 commit 4ed43a6
1 file changed
Lines changed: 23 additions & 0 deletions
File tree
- springboot-starter-data-fast/src/test/java/com/codingapi/springboot/fast
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
35 | 58 | | |
36 | 59 | | |
37 | 60 | | |
| |||
0 commit comments