Commit 2bf57af
authored
Flaky test fixes (#580)
# Summary
This PR aims to reduce the flakiness of the following tests:
### e2e_multi_cluster_sharded_snippets
Increased the timeout of `test_running`, since in failing
[runs](https://spruce.mongodb.com/task/mongodb_kubernetes_e2e_multi_cluster_kind_e2e_multi_cluster_sharded_snippets_7272a430f4150a5fa67753ae6dc4bcce3ba293e8_25_11_10_08_47_17/files?execution=0&sorts=STATUS%3AASC),
by the time the diagnostics are collected, the resources become ready.
### e2e_multi_cluster_appdb_upgrade_downgrade_v1_27_to_mck
Increased the timeout of `test_scale_appdb`. Similarly, the assertion on
appdb status fails, but by the time diagnostics are collected, the
resource becomes ready.
### e2e_appdb_tls_operator_upgrade_v1_32_to_mck
In this test we have a race condition.
```
om-appdb-upgrade-tls 1 7.0.18 Running Pending Disabled 17m
om-appdb-upgrade-tls 1 7.0.18 Running Running Disabled 17m
om-appdb-upgrade-tls 1 7.0.18 Pending Running Disabled 17m
om-appdb-upgrade-tls 1 7.0.18 Pending Running Disabled 18m
om-appdb-upgrade-tls 1 7.0.18 Pending Running Disabled 18m
om-appdb-upgrade-tls 1 7.0.18 Running Running Disabled 19m
```
There is a moment during the operator upgrade where the resource has the
status of AppDB and OM set to running. This happens very briefly before
the operator starts reconciling OM and sets the OM status to Pending. In
that moment, the test will very quickly pass both assertions and move on
to assert healthiness by connecting to OM. This will fail since OM was
not actually ready.
```
Reaching phase Running for resource AppDbStatus took 216.2561867237091s
Reaching phase Running for resource OmStatus took 0.0025169849395751953s
```
To fix this, I added a `persist_for` flag in our assertion methods. This
makes sure that the phase we are currently asserting is reached and
persists for a number of retries.
## Proof of Work
Retried the above tests a few times, and all pass
https://spruce.mongodb.com/version/6911c25146ed0e00077796e3/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC
## Checklist
- [ ] Have you linked a jira ticket and/or is the ticket in the title?
- [ ] Have you checked whether your jira ticket required DOCSP changes?
- [ ] Have you added changelog file?
- use `skip-changelog` label if not needed
- refer to [Changelog files and Release
Notes](https://github.com/mongodb/mongodb-kubernetes/blob/master/CONTRIBUTING.md#changelog-files-and-release-notes)
section in CONTRIBUTING.md for more details1 parent 2c19908 commit 2bf57af
File tree
5 files changed
+70
-13
lines changed- docker/mongodb-kubernetes-tests
- kubetester
- tests
- multicluster_appdb
- multicluster_shardedcluster
- upgrades
5 files changed
+70
-13
lines changedLines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
15 | 28 | | |
16 | 29 | | |
17 | 30 | | |
18 | 31 | | |
19 | 32 | | |
| 33 | + | |
20 | 34 | | |
21 | 35 | | |
22 | 36 | | |
23 | 37 | | |
24 | 38 | | |
25 | 39 | | |
26 | 40 | | |
27 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
28 | 47 | | |
29 | 48 | | |
30 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
| 1020 | + | |
1027 | 1021 | | |
1028 | 1022 | | |
1029 | 1023 | | |
| |||
1057 | 1051 | | |
1058 | 1052 | | |
1059 | 1053 | | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1060 | 1089 | | |
1061 | 1090 | | |
1062 | 1091 | | |
| |||
1113 | 1142 | | |
1114 | 1143 | | |
1115 | 1144 | | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1116 | 1148 | | |
1117 | 1149 | | |
1118 | 1150 | | |
| |||
1159 | 1191 | | |
1160 | 1192 | | |
1161 | 1193 | | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
1162 | 1197 | | |
1163 | 1198 | | |
1164 | 1199 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
166 | 169 | | |
167 | 170 | | |
168 | 171 | | |
| |||
0 commit comments