Move setting worker as active closer to AuthorizeSession in the hopes that the liveness period doesn't pass before the AuthorizeSession can be called. (#1348)

pull/1349/head
Todd Knight 5 years ago committed by GitHub
parent c058c08907
commit 6766704687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1826,16 +1826,6 @@ func TestAuthorizeSession(t *testing.T) {
})
require.NoError(t, err)
// Tell our DB that there is a worker ready to serve the data
workerService := workers.NewWorkerServiceServer(hclog.Default(), serversRepoFn, sessionRepoFn, &sync.Map{}, kms)
_, err = workerService.Status(ctx, &spbs.StatusRequest{
Worker: &spb.Server{
PrivateId: "testworker",
Address: "localhost:8457",
},
})
require.NoError(t, err)
v := vault.NewTestVaultServer(t)
v.MountPKI(t)
sec, tok := v.CreateToken(t, vault.WithPolicies([]string{"default", "boundary-controller", "pki"}))
@ -1863,6 +1853,16 @@ func TestAuthorizeSession(t *testing.T) {
})
require.NoError(t, err)
// Tell our DB that there is a worker ready to serve the data
workerService := workers.NewWorkerServiceServer(hclog.Default(), serversRepoFn, sessionRepoFn, &sync.Map{}, kms)
_, err = workerService.Status(ctx, &spbs.StatusRequest{
Worker: &spb.Server{
PrivateId: "testworker",
Address: "localhost:8457",
},
})
require.NoError(t, err)
asRes1, err := s.AuthorizeSession(ctx, &pbs.AuthorizeSessionRequest{
Id: tar.GetPublicId(),
})

Loading…
Cancel
Save