-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix/kubernetes-pod-status #216
base: main
Are you sure you want to change the base?
Conversation
Test Results360 tests 352 ✅ 38m 45s ⏱️ Results for commit 9f75936. ♻️ This comment has been updated with latest results. |
...cenario_execution_kubernetes/scenario_execution_kubernetes/kubernetes_wait_for_pod_status.py
Show resolved
Hide resolved
...cenario_execution_kubernetes/scenario_execution_kubernetes/kubernetes_wait_for_pod_status.py
Outdated
Show resolved
Hide resolved
if not isinstance(status, tuple) or not isinstance(status[0], str): | ||
raise ValueError("Status expected to be enum.") | ||
self.expected_status = status[0] | ||
self.regex = regex | ||
self.current_state = KubernetesWaitForPodStatusState.MONITORING | ||
self.is_pod = False | ||
self.monitoring_thread = threading.Thread(target=self.watch_pods, daemon=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this creates a new thread for every execution. Instead please rework the previous solution
--> in update() when getting the last element from update_queue (line 58) , store the item in a member variable (e.g. self.current_state). This allows you to keep the state for another execution. Then you can rework the update() function:
- move the check within update() into a separate function.
- update() should look something like that afterwards:
if self.update_queue().empty():
if self.current_state is not None and check(self.current_state):
return SUCCESS
return RUNNING
else:
while not self.update_queue.empty():
self.current_state = self.update_queue.get()
if check(self.current_state):
return SUCCESS
return RUNNING
Description
Pod status action fails to detect the pod status.
Pull request checklist
make check
) pass locallyPull request type
Current behavior
New behavior
How to test