Skip to content

Commit

Permalink
chore: fix flaky test TestGetAccessJwt (#8818)
Browse files Browse the repository at this point in the history
This test does not talk to Alpha and requires setting up
the TTL to 20 second.
  • Loading branch information
mangalaman93 committed May 6, 2023
1 parent c3fbb95 commit 6cd2dfc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions edgraph/access_ee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func TestValidateToken(t *testing.T) {
}

func TestGetAccessJwt(t *testing.T) {

grpLst := []acl.Group{
{
Uid: "100",
Expand Down Expand Up @@ -100,8 +99,10 @@ func TestGetAccessJwt(t *testing.T) {
{3456789012, "user3", []string{"702", "703"}},
}

worker.Config.AccessJwtTtl = 20 * time.Second
for _, userdata := range userDataList {
jwtstr, _ := getAccessJwt(userdata.userId, grpLst, userdata.namespace)
jwtstr, err := getAccessJwt(userdata.userId, grpLst, userdata.namespace)
require.NoError(t, err)
ud, err := validateToken(jwtstr)
require.NoError(t, err)
if ud.namespace != userdata.namespace || ud.userId != userdata.userId || !sliceCompare(ud.groupIds, g) {
Expand Down

0 comments on commit 6cd2dfc

Please sign in to comment.