From d724992490b7c67539d060388a855f394f2d9cd0 Mon Sep 17 00:00:00 2001 From: Drew Malin Date: Wed, 24 Sep 2025 16:37:21 -0700 Subject: [PATCH 1/2] run validate and terminate sequentially --- v1/providers/shadeform/validation_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/v1/providers/shadeform/validation_test.go b/v1/providers/shadeform/validation_test.go index f59a4cfb..d9d08abb 100644 --- a/v1/providers/shadeform/validation_test.go +++ b/v1/providers/shadeform/validation_test.go @@ -40,7 +40,6 @@ func TestInstanceLifecycleValidation(t *testing.T) { } func TestInstanceTypeFilter(t *testing.T) { - t.Parallel() checkSkip(t) apiKey := getAPIKey() @@ -109,13 +108,11 @@ func TestInstanceTypeFilter(t *testing.T) { require.NotNil(t, instance) t.Run("ValidateSSHAccessible", func(t *testing.T) { - t.Parallel() err := v1.ValidateInstanceSSHAccessible(ctx, client, instance, ssh.GetTestPrivateKey()) require.NoError(t, err, "ValidateSSHAccessible should pass") }) t.Run("ValidateTerminateInstance", func(t *testing.T) { - t.Parallel() err := v1.ValidateTerminateInstance(ctx, client, instance) require.NoError(t, err, "ValidateTerminateInstance should pass") }) From 7f79e08ee47713de4b3db3a93b47d0d4b52fe656 Mon Sep 17 00:00:00 2001 From: Drew Malin Date: Wed, 24 Sep 2025 17:09:42 -0700 Subject: [PATCH 2/2] use faster instance type --- internal/ssh/ssh.go | 14 +++++++------- v1/providers/shadeform/validation_test.go | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/ssh/ssh.go b/internal/ssh/ssh.go index adba0398..700e31b2 100644 --- a/internal/ssh/ssh.go +++ b/internal/ssh/ssh.go @@ -31,7 +31,7 @@ func ConnectToHost(ctx context.Context, config ConnectionConfig) (*Client, error dial: d.DialContext, privateKey: config.PrivKey, } - fmt.Printf("local_ip: %s, public_ip: %s\n", localIP, publicIP) + fmt.Printf("local_ip: %s, public_ip: %s\n", localIP, publicIP) // TODO: use logger err := sshClient.Connect(ctx) if err != nil { return nil, fmt.Errorf("failed to connect: %w", err) @@ -242,19 +242,19 @@ func StartTestSSHServer(options TestSSHServerOptions) (func() error, error) { authorizedKey := gossh.MarshalAuthorizedKey(s.PublicKey()) _, err := io.WriteString(s, fmt.Sprintf("public key used by %s:\n", s.User())) // writes to client output if err != nil { - fmt.Println(err) + fmt.Println(err) // TODO: use logger } _, err = s.Write(authorizedKey) if err != nil { - fmt.Println(err) + fmt.Println(err) // TODO: use logger } _, err = s.Write([]byte(s.RawCommand())) if err != nil { - fmt.Println(err) + fmt.Println(err) // TODO: use logger } err = s.Exit(options.ExitCode) if err != nil { - fmt.Println(err) + fmt.Println(err) // TODO: use logger } } @@ -275,7 +275,7 @@ func StartTestSSHServer(options TestSSHServerOptions) (func() error, error) { go func() { err1 := server.ListenAndServe() if err1 != nil { - fmt.Println(err1) + fmt.Println(err1) // TODO: use logger } }() time.Sleep(100 * time.Millisecond) @@ -377,7 +377,7 @@ func TrySSHConnect(ctx context.Context, c ConnectionConfig, options WaitForSSHOp defer func() { if closeErr := con.Close(); closeErr != nil { // Log close error but don't return it as it's not the primary error - fmt.Printf("warning: failed to close SSH connection: %v\n", closeErr) + fmt.Printf("warning: failed to close SSH connection: %v\n", closeErr) // TODO: use logger } }() _, _, err = con.RunCommand(ctx, options.CheckCmd) diff --git a/v1/providers/shadeform/validation_test.go b/v1/providers/shadeform/validation_test.go index d9d08abb..d62756bc 100644 --- a/v1/providers/shadeform/validation_test.go +++ b/v1/providers/shadeform/validation_test.go @@ -49,8 +49,8 @@ func TestInstanceTypeFilter(t *testing.T) { client := NewShadeformClient("validation-test", apiKey) client.WithConfiguration(Configuration{ AllowedInstanceTypes: map[openapi.Cloud]map[string]bool{ - openapi.DATACRUNCH: { - "B200": true, + openapi.HYPERSTACK: { + "A4000": true, }, }, }) @@ -59,7 +59,7 @@ func TestInstanceTypeFilter(t *testing.T) { require.NoError(t, err) require.NotEmpty(t, types, "Should have instance types") require.True(t, len(types) == 1, "Instance types should return only one entry") - require.True(t, types[0].Type == "datacrunch_B200", "returned instance type does not match expectations") + require.True(t, types[0].Type == "hyperstack_A4000", "returned instance type does not match expectations") if !types[0].IsAvailable { return