Skip to content

Commit

Permalink
src/timeout: set timed-out checkout result
Browse files Browse the repository at this point in the history
Set timed-out `checkout` node result to `incomplete`
while in `running` state. As it denotes that the node
timed-out while checkout was still going on.
Also, set error related information i.e. `error_code`
and `error_msg`.

Signed-off-by: Jeny Sadadia <[email protected]>
  • Loading branch information
Jeny Sadadia authored and nuclearcat committed Apr 19, 2024
1 parent d3f1a80 commit 7b43687
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,15 @@ def _submit_lapsed_nodes(self, lapsed_nodes, state, mode):
node_update['state'] = state
self.log.debug(f"{node_id} {mode}")
if mode == 'TIMEOUT':
if node['kind'] != 'checkout':
if node['kind'] == 'checkout' and node['state'] != 'running':
node_update['result'] = 'pass'
else:
if 'data' not in node_update:
node_update['data'] = {}
node_update['result'] = 'incomplete'
node_update['data']['error_code'] = 'node_timeout'
else:
if node_update['state'] == 'running':
node_update['result'] = 'fail'
else:
node_update['result'] = 'pass'
node_update['data']['error_msg'] = 'Node timed-out'

if node['kind'] == 'checkout' and mode == 'DONE':
node_update['result'] = 'pass'

Expand Down

0 comments on commit 7b43687

Please sign in to comment.