Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify the test case of shortestspaths3 to make its results determini… #4431

Merged
merged 4 commits into from
Jul 18, 2022

Conversation

xtcyclist
Copy link
Contributor

@xtcyclist xtcyclist commented Jul 15, 2022

…stic, given that match with shortestPath() may return one shortest path, not all of them.

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

#4424

Description:

The original test case

      MATCH (a:player{name:"Tim Duncan"}), (b:team)
      MATCH p = shortestPath( (a)-[e:serve*..3]-(b) )
      RETURN p

may return only one shortestPath() between the src and the end, not all of them. The exact path returned depends on the state of the database. It's not deterministic. So it happens that this test case fails with an expected result.

The behavior of shortestPath() is to be discussed. Maybe it should return all shortest paths with the same shortest length. Or, maybe an allshortestpath() should be added?

For the time being, I recommend modifying this query to pass this test case.

How do you solve it?

Modified the return values in the query to have deterministic results.

      MATCH (a:player{name:"Tim Duncan"}), (b:team)
      MATCH p = shortestPath( (a)-[e:serve*..3]-(b) )
      RETURN b, length(p)

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

…stic, given that match with shortestPath() may return one shortest path, not all of them.
@xtcyclist xtcyclist added ready-for-testing PR: ready for the CI test ready for review labels Jul 15, 2022
nevermore3
nevermore3 previously approved these changes Jul 15, 2022
@Sophie-Xie Sophie-Xie requested a review from codesigner July 15, 2022 08:39
@codecov-commenter
Copy link

Codecov Report

Merging #4431 (bae8120) into master (7981108) will increase coverage by 0.06%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4431      +/-   ##
==========================================
+ Coverage   84.51%   84.57%   +0.06%     
==========================================
  Files        1345     1345              
  Lines      134035   134043       +8     
==========================================
+ Hits       113284   113372      +88     
+ Misses      20751    20671      -80     
Impacted Files Coverage Δ
src/common/geo/io/wkb/WKBReader.cpp 94.11% <0.00%> (-2.27%) ⬇️
src/storage/admin/AdminTaskManager.cpp 80.80% <0.00%> (-1.61%) ⬇️
src/storage/mutate/AddVerticesProcessor.cpp 84.25% <0.00%> (-1.28%) ⬇️
src/codec/RowReaderWrapper.cpp 78.57% <0.00%> (-1.03%) ⬇️
src/common/fs/FileUtils.cpp 73.66% <0.00%> (-0.66%) ⬇️
src/storage/admin/RebuildIndexTask.cpp 72.54% <0.00%> (-0.66%) ⬇️
src/common/datatypes/Geography.cpp 62.00% <0.00%> (-0.63%) ⬇️
src/common/fs/test/FileUtilsTest.cpp 99.52% <0.00%> (-0.48%) ⬇️
src/codec/RowWriterV2.cpp 84.60% <0.00%> (-0.31%) ⬇️
src/graph/validator/Validator.cpp 84.31% <0.00%> (-0.26%) ⬇️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7981108...bae8120. Read the comment docs.

@Sophie-Xie Sophie-Xie added this to the v3.3.0 milestone Jul 18, 2022
@Sophie-Xie Sophie-Xie merged commit 2dd6f15 into vesoft-inc:master Jul 18, 2022
@jievince jievince mentioned this pull request Aug 30, 2022
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants