Skip to content
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(robot-server): Update tests to properly check new bad run records #14723

Merged
merged 5 commits into from
Mar 25, 2024

Conversation

SyntaxColoring
Copy link
Contributor

@SyntaxColoring SyntaxColoring commented Mar 25, 2024

Overview

Follow-ups for #14711 (comment).

#14711 added safer error propagation for when robot-server encounters bad stored run data. As part of that, if it finds a run where the state_summary SQL column is NULL, it treats that as bad data and propagates the error to HTTP clients.

When you restart the robot while there is an active run, then no state summary will be inserted (this only happens when the run is ended and the state moves from engine to sql) and the run will be bad.

We say that this is in fact a bad run because to the client, there is no distinction between state summary and run. A run with an empty state summary does not have correct data and does not represent what occurred.

Add a regression test to make sure this is how we handle runs that did not have state summaries persisted.

Testing

  • create a run with this branch on a flex and restart the flex (or kill the robot server process - this isn't about the details of when things are written to disk, just the lifetime of the data here) and see that the run is now bad

@SyntaxColoring SyntaxColoring changed the title fix(robot-server): Fix certain good runs being marked as bad fix(robot-server): Fix runs that were interrupted by a restart being marked as bad Mar 25, 2024
@sfoster1
Copy link
Member

Do we actually want to treat these differently? Is there a difference? Like, this is in fact a run that could not have its data loaded and is in fact bad.

@sfoster1 sfoster1 marked this pull request as ready for review March 25, 2024 16:49
@sfoster1 sfoster1 requested a review from a team as a code owner March 25, 2024 16:49
Copy link
Contributor

@TamarZanzouri TamarZanzouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once CI passes

Copy link
Contributor Author

@SyntaxColoring SyntaxColoring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't approve this because I originated the PR, but LGTM. Thank you!

@sfoster1 sfoster1 changed the title fix(robot-server): Fix runs that were interrupted by a restart being marked as bad fix(robot-server): Update tests to properly check new bad run records Mar 25, 2024
@sfoster1 sfoster1 merged commit 244a80e into edge Mar 25, 2024
7 checks passed
@sfoster1 sfoster1 deleted the tests_account_for_bad_runs branch March 25, 2024 22:37
Carlos-fernandez pushed a commit that referenced this pull request May 20, 2024
…#14723)

# Overview

Follow-ups for
#14711 (comment).

#14711 added safer error propagation for when robot-server encounters
bad stored run data. As part of that, if it finds a run where the
`state_summary` SQL column is `NULL`, it treats that as bad data and
propagates the error to HTTP clients.

When you restart the robot while there is an active run, then no state
summary will be inserted (this only happens when the run is ended and
the state moves from engine to sql) and the run will be bad.

We say that this is in fact a bad run because to the client, there is no
distinction between state summary and run. A run with an empty state
summary does not have correct data and does not represent what occurred.

Add a regression test to make sure this is how we handle runs that did
not have state summaries persisted.

# Testing
- [x] create a run with this branch on a flex and restart the flex (or
kill the robot server process - this isn't about the details of when
things are written to disk, just the lifetime of the data here) and see
that the run is now bad

---------

Co-authored-by: Seth Foster <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants