Skip to content

Commit 7fcf95a

Browse files
committed
fix(controlplane): stop fake GCS server on test teardown
The fake-gcs-server upgrade no longer tolerates stopping the server before the tests run, so move the Stop call from SetupTest to TearDownTest. Assisted-by: Claude Code Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev> Chainloop-Trace-Sessions: d31e2664-2e8f-4fba-af3c-11a534992986
1 parent 6026cf9 commit 7fcf95a

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

app/controlplane/plugins/core/guac/v1/guac_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright 2023 The Chainloop Authors.
2+
// Copyright 2023-2026 The Chainloop Authors.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
55
// you may not use this file except in compliance with the License.
@@ -115,22 +115,26 @@ func (s *testSuite) TestUniqueFilename() {
115115

116116
type testSuite struct {
117117
suite.Suite
118+
server *fakestorage.Server
118119
client *storage.Client
119120
bucket string
120121
}
121122

122123
func (s *testSuite) SetupTest() {
123-
server := fakestorage.NewServer([]fakestorage.Object{
124+
s.server = fakestorage.NewServer([]fakestorage.Object{
124125
{
125126
ObjectAttrs: fakestorage.ObjectAttrs{BucketName: "existing-bucket"},
126127
},
127128
})
128-
defer server.Stop()
129129

130-
s.client = server.Client()
130+
s.client = s.server.Client()
131131
s.bucket = "existing-bucket"
132132
}
133133

134+
func (s *testSuite) TearDownTest() {
135+
s.server.Stop()
136+
}
137+
134138
// Run all the tests
135139
func TestGuacIntegration(t *testing.T) {
136140
suite.Run(t, new(testSuite))

0 commit comments

Comments
 (0)