Skip to content

Commit b70cea9

Browse files
authored
testserver: add missing synchronization (#2932)
Follow up to #2816
1 parent 0aca1bc commit b70cea9

4 files changed

Lines changed: 9 additions & 1 deletion

File tree

libs/testserver/apps.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ func (s *FakeWorkspace) AppsUpsert(req Request, name string) Response {
1919
}
2020
}
2121

22+
defer s.LockUnlock()()
23+
2224
if name != "" {
2325
_, ok := s.Apps[name]
2426
if !ok {

libs/testserver/quality_monitors.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ func (s *FakeWorkspace) QualityMonitorUpsert(req Request, tableName string, chec
2727
}
2828
}
2929

30+
defer s.LockUnlock()()
31+
3032
if checkExists {
3133
_, ok := s.Monitors[tableName]
3234
if !ok {

libs/testserver/schemas.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import (
1010
)
1111

1212
func (s *FakeWorkspace) SchemasCreate(req Request) Response {
13+
defer s.LockUnlock()()
14+
1315
var schema catalog.SchemaInfo
1416

1517
if err := json.Unmarshal(req.Body, &schema); err != nil {
@@ -27,6 +29,8 @@ func (s *FakeWorkspace) SchemasCreate(req Request) Response {
2729
}
2830

2931
func (s *FakeWorkspace) SchemasUpdate(req Request, name string) Response {
32+
defer s.LockUnlock()()
33+
3034
existing, ok := s.Schemas[name]
3135
if !ok {
3236
return Response{

libs/testserver/volumes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/databricks/databricks-sdk-go/service/catalog"
99
)
1010

11-
func (s *FakeWorkspace) VolumesCreate(req Request) Response {
11+
func (*FakeWorkspace) VolumesCreate(req Request) Response {
1212
var volume catalog.VolumeInfo
1313

1414
if err := json.Unmarshal(req.Body, &volume); err != nil {

0 commit comments

Comments
 (0)