Skip to content

Commit

Permalink
Edit test cases to remove flaky behavior (#5464)
Browse files Browse the repository at this point in the history
  • Loading branch information
all-seeing-code authored May 19, 2020
1 parent 3fc8571 commit bae2b1b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion query/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ func populateCluster() {
<52> <connects> <54> (weight=10) .
<54> <connects> <51> (weight=10) .
<54> <connects> <52> (weight=1) .
<54> <connects> <52> (weight=2) .
<54> <connects> <53> (weight=10) .
<54> <connects> <55> (weight=1) .
Expand Down
92 changes: 46 additions & 46 deletions query/query3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ func TestKShortestPathTwoPaths(t *testing.T) {
query := `
{
A as shortest(from: 51, to:55, numpaths: 2, depth:2) {
connects
connects @facets(weight)
}
me(func: uid(A)) {
name
Expand All @@ -702,44 +702,44 @@ func TestKShortestPathTwoPaths(t *testing.T) {
js := processQueryNoErr(t, query)
require.JSONEq(t, `{
"data": {
"me": [
{
"name": "A"
},
{
"name": "D"
},
{
"name": "E"
}
],
"_path_": [
{
"connects": {
"connects": {
"uid": "0x37"
},
"uid": "0x36"
},
"uid": "0x33",
"_weight_": 2
},
{
"connects": {
"connects": {
"connects": {
"uid": "0x37"
},
"uid": "0x36"
},
"uid": "0x34"
},
"uid": "0x33",
"_weight_": 3
}
]
"me": [
{"name": "A"},
{"name": "C"},
{"name": "D"},
{"name": "E"}
],
"_path_": [
{
"connects": {
"connects": {
"connects": {
"uid": "0x37"
},
"connects|weight": 1,
"uid": "0x36"
},
"connects|weight": 1,
"uid": "0x35"
},
"connects|weight": 1,
"uid": "0x33",
"_weight_": 3
},
{
"connects": {
"connects": {
"uid": "0x37"
},
"connects|weight": 1,
"uid": "0x36"
},
"connects|weight": 10,
"uid": "0x33",
"_weight_": 11
}
]
}
}`, js)
}`, js)
}

// There are 5 paths between 51 to 55 under "connects" predicate.
Expand Down Expand Up @@ -1111,15 +1111,15 @@ func TestShortestPathWithDepth(t *testing.T) {
"connects": {
"uid": "0x34"
},
"connects|weight": 1,
"connects|weight": 2,
"uid": "0x36"
},
"connects|weight": 1,
"uid": "0x35"
},
"connects|weight": 1,
"uid": "0x33",
"_weight_": 3
"_weight_": 4
}
]
}
Expand All @@ -1142,15 +1142,15 @@ func TestShortestPathWithDepth(t *testing.T) {
"connects": {
"uid": "0x34"
},
"connects|weight": 1,
"connects|weight": 2,
"uid": "0x36"
},
"connects|weight": 1,
"uid": "0x35"
},
"connects|weight": 1,
"uid": "0x33",
"_weight_": 3
"_weight_": 4
},
{
"connects": {
Expand All @@ -1177,12 +1177,12 @@ func TestShortestPathWithDepth(t *testing.T) {
"connects": {
"uid": "0x34"
},
"connects|weight": 1,
"connects|weight": 2,
"uid": "0x36"
},
"connects|weight": 10,
"uid": "0x33",
"_weight_": 11
"_weight_": 12
},
{
"connects": {
Expand Down Expand Up @@ -1302,9 +1302,9 @@ func TestShortestPathWithDepth_direct_path_is_shortest(t *testing.T) {
"connects": {
"uid": "0x34"
},
"connects|weight": 1,
"connects|weight": 2,
"uid": "0x36",
"_weight_": 1
"_weight_": 2
}
]
}
Expand Down

0 comments on commit bae2b1b

Please sign in to comment.