|
117 | 117 | node_pool=node_pool_info, |
118 | 118 | ) |
119 | 119 |
|
| 120 | + # Intentionally create a node pool with problematic configurations |
| 121 | + # to validate that it enters the ERROR state. |
| 122 | + task_id = "create_problematic_node_pool_info" |
| 123 | + create_problematic_node_pool_info = node_pool.create.override( |
| 124 | + task_id=task_id, |
| 125 | + owner=test_owner.YUNA_T, |
| 126 | + )( |
| 127 | + node_pool=problematic_node_pool_info, |
| 128 | + # The failure is intentionally ignored because we want to validate |
| 129 | + # that the status of the node pool (which fails to be created) is |
| 130 | + # "ERROR". |
| 131 | + ignore_failure=True, |
| 132 | + ) |
| 133 | + |
120 | 134 | task_id = "wait_for_provisioning" |
121 | 135 | wait_for_provisioning = node_pool.wait_for_status.override( |
122 | 136 | task_id=task_id |
|
165 | 179 | node_pool=node_pool_info, status=node_pool.Status.STOPPING |
166 | 180 | ) |
167 | 181 |
|
168 | | - # Intentionally create a node pool with problematic configurations |
169 | | - # to validate that it enters the ERROR state. |
170 | | - task_id = "create_problematic_node_pool_info" |
171 | | - create_problematic_node_pool_info = node_pool.create.override( |
172 | | - task_id=task_id, |
173 | | - owner=test_owner.YUNA_T, |
174 | | - )( |
175 | | - node_pool=problematic_node_pool_info, |
176 | | - # The failure is intentionally ignored because we want to validate |
177 | | - # that the status of the node pool (which fails to be created) is |
178 | | - # "ERROR". |
179 | | - ignore_failure=True, |
180 | | - ) |
181 | | - |
182 | 182 | task_id = "wait_for_error" |
183 | | - wait_for_error = node_pool.wait_for_status.override(task_id=task_id)( |
184 | | - node_pool=problematic_node_pool_info, status=node_pool.Status.ERROR |
185 | | - ) |
186 | | - |
187 | | - task_id = "cleanup_wrong_node_pool" |
188 | | - cleanup_wrong_node_pool = node_pool.delete.override( |
189 | | - task_id=task_id, trigger_rule=TriggerRule.ALL_DONE |
190 | | - )(node_pool=problematic_node_pool_info).as_teardown( |
191 | | - setups=create_problematic_node_pool_info, |
| 183 | + validate_problematic_node_pool_enter_error_state = ( |
| 184 | + node_pool.wait_for_status.override(task_id=task_id)( |
| 185 | + node_pool=problematic_node_pool_info, |
| 186 | + status=node_pool.Status.ERROR, |
| 187 | + ) |
192 | 188 | ) |
193 | 189 |
|
194 | 190 | chain( |
|
202 | 198 |
|
203 | 199 | chain( |
204 | 200 | create_problematic_node_pool_info, |
205 | | - wait_for_error, |
| 201 | + validate_problematic_node_pool_enter_error_state, |
206 | 202 | ) |
207 | 203 |
|
208 | 204 | with TaskGroupWithTimeout( |
|
0 commit comments