mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 17:05:43 +03:00
fix alloc list test (#12297)
The alloc list test with pagination was creating allocs before the target namespace existed. This works in OSS but fails in ENT because quotas are checked before the alloc can be created, so the namespace must exist beforehand.
This commit is contained in:
@@ -126,6 +126,10 @@ func TestAllocEndpoint_List_PaginationFiltering(t *testing.T) {
|
||||
|
||||
state := s1.fsm.State()
|
||||
|
||||
require.NoError(t, state.UpsertNamespaces(1099, []*structs.Namespace{
|
||||
{Name: "non-default"},
|
||||
}))
|
||||
|
||||
var allocs []*structs.Allocation
|
||||
for i, m := range mocks {
|
||||
allocsInTx := []*structs.Allocation{}
|
||||
@@ -146,10 +150,6 @@ func TestAllocEndpoint_List_PaginationFiltering(t *testing.T) {
|
||||
require.NoError(t, state.UpsertAllocs(structs.MsgTypeTestSetup, index, allocsInTx))
|
||||
}
|
||||
|
||||
require.NoError(t, state.UpsertNamespaces(1099, []*structs.Namespace{
|
||||
{Name: "non-default"},
|
||||
}))
|
||||
|
||||
aclToken := mock.CreatePolicyAndToken(t,
|
||||
state, 1100, "test-valid-read",
|
||||
mock.NamespacePolicy("*", "read", nil),
|
||||
|
||||
Reference in New Issue
Block a user