Skip to content

Fix clear old sessions for local (BugFix)#1708

Merged
fernando79513 merged 12 commits intomainfrom
fix_clear_old_sessions
Feb 19, 2025
Merged

Fix clear old sessions for local (BugFix)#1708
fernando79513 merged 12 commits intomainfrom
fix_clear_old_sessions

Conversation

@Hook25
Copy link
Copy Markdown
Collaborator

@Hook25 Hook25 commented Feb 4, 2025

Description

This fixes the --clear-old-sessions flag being overall ignored, also, it fixes the way that these flags are used for local only.

Lastly, it fixes a missing catch for both local and remote, that would make the agent crash when a selected job is deleted (from an update or manually) and a session is then resumed (as the error won't be InvalidJobError but CorruptedSessionError).

Resolved issues

Fixes: CHECKBOX-1710

Documentation

N/A

Tests

New metabox test that stresses this scenario for local

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 90.24390% with 4 lines in your changes missing coverage. Please review.

Project coverage is 49.30%. Comparing base (1a56005) to head (36d1443).
Report is 131 commits behind head on main.

Files with missing lines Patch % Lines
checkbox-ng/checkbox_ng/launcher/controller.py 50.00% 2 Missing ⚠️
checkbox-ng/checkbox_ng/utils.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1708      +/-   ##
==========================================
+ Coverage   49.26%   49.30%   +0.03%     
==========================================
  Files         373      373              
  Lines       40435    40454      +19     
  Branches     6830     6834       +4     
==========================================
+ Hits        19922    19946      +24     
+ Misses      19785    19783       -2     
+ Partials      728      725       -3     
Flag Coverage Δ
checkbox-ng ∅ <90.24%> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fernando79513 fernando79513 self-assigned this Feb 5, 2025
Copy link
Copy Markdown
Collaborator

@fernando79513 fernando79513 left a comment

Choose a reason for hiding this comment

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

LGTM!
I tried the --clear-old-session flag and seems to work fine.
Taking a look at the debug logs, they seem really verbose, I wonder if some of them should be traces instead. Anyways, it's not something to tackle here.

fernando79513
fernando79513 previously approved these changes Feb 10, 2025
@Hook25 Hook25 force-pushed the fix_clear_old_sessions branch from 3b48ee2 to a361693 Compare February 19, 2025 10:38
* Result fetching for run_cmd

* Give the result half a second to materialize

* Add result to the ExecuteResult

* Preserve all fields on check

* Wrong check called

* Check is not a property

* Trace metabox output

* Rollback the binary load to test, make result array

* Set the cmd to none in non-interactive for now

* Revert trace logging

* Purge debug files

* Remove pointless append

* Use reference in the url comment

Co-authored-by: Pierre Equoy <pierre.equoy@canonical.com>

---------

Co-authored-by: Pierre Equoy <pierre.equoy@canonical.com>
@fernando79513 fernando79513 merged commit a108916 into main Feb 19, 2025
27 checks passed
@fernando79513 fernando79513 deleted the fix_clear_old_sessions branch February 19, 2025 16:24
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.

2 participants