Skip to content

Commit

Permalink
fix some test failures. need to look into secret failure that are occ…
Browse files Browse the repository at this point in the history
…uring

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
  • Loading branch information
cicoyle committed Jan 15, 2024
1 parent 5f3f28f commit d68b1d8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/api/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,15 +696,15 @@ func (a *api) getStateStoreWithRequestValidation(reqCtx *fasthttp.RequestCtx) (s
storeName := a.getStateStoreName(reqCtx)

if a.universal.CompStore().StateStoresLen() == 0 {
err := apierrors.NotConfigured(storeName, string(contribMetadata.StateStoreType)+" store", nil, codes.FailedPrecondition, nethttp.StatusInternalServerError, "ERR_STATE_STORE_NOT_CONFIGURED", kiterrors.CodePrefixStateStore+kiterrors.CodeNotConfigured)
err := apierrors.NotConfigured(storeName, string(contribMetadata.StateStoreType)+" store", map[string]string{"appID": a.universal.AppID()}, codes.FailedPrecondition, nethttp.StatusInternalServerError, "ERR_STATE_STORE_NOT_CONFIGURED", kiterrors.CodePrefixStateStore+kiterrors.CodeNotConfigured)
log.Debug(err)
universalFastHTTPErrorResponder(reqCtx, err)
return nil, "", err
}

stateStore, ok := a.universal.CompStore().GetStateStore(storeName)
if !ok {
err := apierrors.NotFound(storeName, string(contribMetadata.StateStoreType)+" store", nil, codes.InvalidArgument, nethttp.StatusBadRequest, "ERR_STATE_STORE_NOT_FOUND", kiterrors.CodePrefixStateStore+kiterrors.CodeNotFound)
err := apierrors.NotFound(storeName, string(contribMetadata.StateStoreType)+" store", map[string]string{"appID": a.universal.AppID()}, codes.InvalidArgument, nethttp.StatusBadRequest, "ERR_STATE_STORE_NOT_FOUND", kiterrors.CodePrefixStateStore+kiterrors.CodeNotFound)
log.Debug(err)
universalFastHTTPErrorResponder(reqCtx, err)
return nil, "", err
Expand Down Expand Up @@ -1911,15 +1911,15 @@ func (a *api) onPostStateTransaction(reqCtx *fasthttp.RequestCtx) {
storeName := reqCtx.UserValue(storeNameParam).(string)

if a.universal.CompStore().StateStoresLen() == 0 {
err := apierrors.NotConfigured(storeName, string(contribMetadata.StateStoreType)+" store", nil, codes.FailedPrecondition, nethttp.StatusInternalServerError, "ERR_STATE_STORE_NOT_CONFIGURED", kiterrors.CodePrefixStateStore+kiterrors.CodeNotConfigured)
err := apierrors.NotConfigured(storeName, string(contribMetadata.StateStoreType)+" store", map[string]string{"appID": a.universal.AppID()}, codes.FailedPrecondition, nethttp.StatusInternalServerError, "ERR_STATE_STORE_NOT_CONFIGURED", kiterrors.CodePrefixStateStore+kiterrors.CodeNotConfigured)
log.Debug(err)
universalFastHTTPErrorResponder(reqCtx, err)
return
}

store, ok := a.universal.CompStore().GetStateStore(storeName)
if !ok {
err := apierrors.NotFound(storeName, string(contribMetadata.StateStoreType)+" store", nil, codes.InvalidArgument, nethttp.StatusBadRequest, "ERR_STATE_STORE_NOT_FOUND", kiterrors.CodePrefixStateStore+kiterrors.CodeNotFound)
err := apierrors.NotFound(storeName, string(contribMetadata.StateStoreType)+" store", map[string]string{"appID": a.universal.AppID()}, codes.InvalidArgument, nethttp.StatusBadRequest, "ERR_STATE_STORE_NOT_FOUND", kiterrors.CodePrefixStateStore+kiterrors.CodeNotFound)
log.Debug(err)
universalFastHTTPErrorResponder(reqCtx, err)
return
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/suite/daprd/pubsub/grpc/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"fmt"
"os"
"path/filepath"
"runtime"
"testing"

"golang.org/x/net/nettest"
Expand Down Expand Up @@ -54,6 +55,10 @@ type standardizedErrors struct {
}

func (e *standardizedErrors) Setup(t *testing.T) []framework.Option {
if runtime.GOOS == "windows" {
t.Skip("skipping unix socket based test on windows")
}

// Darwin enforces a maximum 104 byte socket name limit, so we need to be a
// bit fancy on how we generate the name.
tmp, err := nettest.LocalPath()
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/suite/daprd/pubsub/http/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"net/http"
"os"
"path/filepath"
"runtime"
"strings"
"testing"

Expand Down Expand Up @@ -54,6 +55,10 @@ type standardizedErrors struct {
}

func (e *standardizedErrors) Setup(t *testing.T) []framework.Option {
if runtime.GOOS == "windows" {
t.Skip("skipping unix socket based test on windows")
}

// Darwin enforces a maximum 104 byte socket name limit, so we need to be a
// bit fancy on how we generate the name.
tmp, err := nettest.LocalPath()
Expand Down

0 comments on commit d68b1d8

Please sign in to comment.