-
Notifications
You must be signed in to change notification settings - Fork 16
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
Bring up previous session #487
base: master
Are you sure you want to change the base?
Conversation
a94ca1f
to
71d5c6c
Compare
I'm not a fan of this idea. It brings significant complexity similar to |
71d5c6c
to
7e1ff8a
Compare
7e1ff8a
to
8a79a7e
Compare
8a79a7e
to
0ba68bc
Compare
72f53ca
to
dd5ec70
Compare
a63b74b
to
0f480a0
Compare
lib/engines/hcktest/hcktest.rb
Outdated
@@ -274,7 +281,7 @@ def run_tests_with_config | |||
next if tests.empty? | |||
|
|||
ResourceScope.open do |scope| | |||
run_clients_and_configure_setup(scope, group => true, create_snapshot: false, boot_from_snapshot: true) | |||
run_clients_and_configure_setup(scope, create_snapshot: false, group => 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.
Why did you change this?
0f480a0
to
df1cc61
Compare
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.
The current implementation will leave an immature session if an error happens before clients get configured. Save the session after it is fully initialized (i.e., all clients are configured).
But this is one of features, you can bring up VM`s for checking what's goin on and where it's crash |
df1cc61
to
1684f10
Compare
lib/cli.rb
Outdated
prop :svvp, T.nilable(T::Boolean) | ||
prop :dump, T.nilable(T::Boolean) | ||
prop :gthb_context_prefix, T.nilable(String) | ||
prop :gthb_context_suffix, T.nilable(String) | ||
prop :playlist, T.nilable(String) | ||
prop :select_test_names, T.nilable(String) | ||
prop :reject_test_names, T.nilable(String) | ||
prop :reject_report_sections, T::Array[String], default: [] | ||
prop :boot_device, T.nilable(String) | ||
prop :allow_test_duplication, T.nilable(T::Boolean) | ||
prop :manual, T.nilable(T::Boolean) | ||
prop :package_with_playlist, T.nilable(T::Boolean) |
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.
Don't see any reason to make boolean fields nilable. String or Array can be nilable because we have logic to check is field specified or not. But in the case of a boolean, we always check true or false.
606c9ec
to
e7b60b5
Compare
The current code will make tests fail in an unpredictable manner instead of reproducing the past failure. It skips creating snapshots and configuration when restored so if some failure has happened in these operations, it will not reproduce the failure, but it will run the following tests with an immature configuration and pose different symptoms that are not useful to debug. |
It runs saved snapshots, and our VM's will be configured exactly as it was,
also on we can open studio and see what happens in previous session
…On Sat, Feb 1, 2025 at 7:42 AM Akihiko Odaki ***@***.***> wrote:
The current implementation will leave an immature session if an error
happens before clients get configured. Save the session after it is fully
initialized (i.e., all clients are configured).
But this is one of features, you can bring up VM`s for checking what's
goin on and where it's crash
The current code will make tests fail in an unpredictable manner instead
of reproducing the past failure. It skips creating snapshots and
configuration when restored so if some failure has happened in these
operations, it will not reproduce the failure, but it will run the
following tests with an immature configuration and pose different symptoms
that are not useful to debug.
—
Reply to this email directly, view it on GitHub
<#487 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANRORQZ7QAQGDXSBTNF6QMT2NRNGBAVCNFSM6AAAAABPO3NUC2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRYG44TAMZYGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
At least the session should be saved at least after snapshots are created, and if the VMs died before configuration, we should configure them before continuing to run tests. The studio should have seen almost no activity at the early stage of execution before running tests; if it experienced a failure at the moment, it means the VM is so broken that it cannot boot or stay running for minutes. Such a scenario should be rare. The easiest way to ensure the VMs are configured is simply to save the session after the configuration. It is sufficient to reproduce failures in tests. |
e7b60b5
to
d0a7e85
Compare
def self.load_session(cli) | ||
session = Models::Session.from_json_file("#{session_path(cli)}/session.json") | ||
|
||
session.common.workspace_path = cli.common.workspace_path |
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.
I don't think it is necessary.
d0a7e85
to
c746b95
Compare
Signed-off-by: Vitalii Chulak <vitalii@daynix.com>
c746b95
to
af3e26e
Compare
@@ -45,7 +45,8 @@ def studio_vm_options | |||
'image_name' => @platform['st_image'], | |||
'logger' => @logger, | |||
'iso_path' => @project.config['iso_path'], | |||
'share_on_host_path' => @project.options.common.share_on_host_path | |||
'share_on_host_path' => @project.options.common.share_on_host_path, | |||
'configured' => @project.restored? |
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 change should be in HCKTest
as HCKTest
coordinates to start VMs that are already configured. This logic is not valid for e.g., HCKInstall
.
end | ||
|
||
def parse(args) | ||
left = @parser.order(args) | ||
@mode = left.shift | ||
@sub_parser[@mode]&.order!(left) unless @mode.nil? | ||
|
||
restore_session if @test.latest_session || @test.session |
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.
Instead of passing self to AutoHCK::Session.load
and letting it modify, let's pass the path to the session.
Such a method may be called from bin/auto_hck
and return an instance of loaded CLI
, which will replace the whole existing CLI
instance.
So instead of having these lines in session.rb
:
cli.test = session.test
cli.common = session.common
...add a line like the following in auto_hck
:
cli = Session.load(session_path)
You don't have to list each attribute of CLI
this way.
WIP