mirror of
https://github.com/portainer/portainer.git
synced 2025-07-30 10:49:40 +02:00
fix(edgegroups): convert the related endpoint IDs to roaring bitmaps to increase performance BE-12053 (#903)
This commit is contained in:
parent
caf382b64c
commit
937456596a
32 changed files with 1041 additions and 133 deletions
|
@ -11,6 +11,7 @@ import (
|
|||
"github.com/portainer/portainer/api/datastore"
|
||||
"github.com/portainer/portainer/api/http/proxy"
|
||||
"github.com/portainer/portainer/api/internal/testhelpers"
|
||||
"github.com/portainer/portainer/api/roar"
|
||||
)
|
||||
|
||||
func TestEndpointDeleteEdgeGroupsConcurrently(t *testing.T) {
|
||||
|
@ -42,9 +43,9 @@ func TestEndpointDeleteEdgeGroupsConcurrently(t *testing.T) {
|
|||
}
|
||||
|
||||
if err := store.EdgeGroup().Create(&portainer.EdgeGroup{
|
||||
ID: 1,
|
||||
Name: "edgegroup-1",
|
||||
Endpoints: endpointIDs,
|
||||
ID: 1,
|
||||
Name: "edgegroup-1",
|
||||
EndpointIDs: roar.FromSlice(endpointIDs),
|
||||
}); err != nil {
|
||||
t.Fatal("could not create edge group:", err)
|
||||
}
|
||||
|
@ -78,7 +79,7 @@ func TestEndpointDeleteEdgeGroupsConcurrently(t *testing.T) {
|
|||
t.Fatal("could not retrieve the edge group:", err)
|
||||
}
|
||||
|
||||
if len(edgeGroup.Endpoints) > 0 {
|
||||
if edgeGroup.EndpointIDs.Len() > 0 {
|
||||
t.Fatal("the edge group is not consistent")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue