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

Travis-CI reports sporadic failures on TestRegexpSearchScorch #1057

Merged
merged 14 commits into from
Nov 30, 2018
Merged

Travis-CI reports sporadic failures on TestRegexpSearchScorch #1057

merged 14 commits into from
Nov 30, 2018

Conversation

rvncerr
Copy link
Contributor

@rvncerr rvncerr commented Nov 28, 2018

FAIL: TestRegexpSearchScorch (0.03s) search_regexp_test.go:148: test 0, expected result 0 to have id � got �, next: &search.DocumentMatch{Index:"", ID:"", IndexInternalID:index.IndexInternalID{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2}, Score:1.916290731874155, Expl:(*search.Explanation)(0xc4235270e0), Locations:search.FieldTermLocationMap(nil), Fragments:search.FieldFragmentMap(nil), Sort:[]string{}, Fields:map[string]interface {}(nil), Document:<nil>, HitNumber:0x0, FieldTermLocations:[]search.FieldTermLocation(nil)} search_regexp_test.go:148: test 1, expected result 0 to have id � got �, next: &search.DocumentMatch{Index:"", ID:"", IndexInternalID:index.IndexInternalID{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3}, Score:0.33875554280828685, Expl:(*search.Explanation)(0xc420c281e0), Locations:search.FieldTermLocationMap(nil), Fragments:search.FieldFragmentMap(nil), Sort:[]string{}, Fields:map[string]interface {}(nil), Document:<nil>, HitNumber:0x0, FieldTermLocations:[]search.FieldTermLocation(nil)} search_regexp_test.go:148: test 1, expected result 1 to have id � got �, next: &search.DocumentMatch{Index:"", ID:"", IndexInternalID:index.IndexInternalID{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4}, Score:0.33875554280828685, Expl:(*search.Explanation)(0xc420c282a0), Locations:search.FieldTermLocationMap(nil), Fragments:search.FieldFragmentMap(nil), Sort:[]string{}, Fields:map[string]interface {}(nil), Document:<nil>, HitNumber:0x0, FieldTermLocations:[]search.FieldTermLocation(nil)}

Fix: clean up index directory after the test - avoiding reusing old index.

abhinavdangeti and others added 9 commits November 28, 2018 13:54
+ Following specification used in elastic search:
    https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html
+ String formats allowed:
    - "lat,lon"
    - "  lat, lon   "
    - "geohash"
+ All the necessary code to decode geohashes is obtained from:
    - https://github.com/mmcloughlin/geohash
+ Also see:
    https://issues.couchbase.com/browse/MB-30542
The currMustNot cursor of the boolean searcher isn't tracked
by the currentID. This means that during Advance(), we'll
need to additionally check to prevent updating the cached
cursor ID for the must not searcher.

Fixes #1029
Re-initialising the default persister nap configs
to favour direct persistence without any naps.
@steveyen
Copy link
Contributor

The last commit a4c05f7 looks good to me, but there seem to be a bunch of extra commits from multiple files before that commit as part of this pull request? Not sure if this is just some weird artifact of github display.

@rvncerr rvncerr changed the base branch from master to alice November 28, 2018 23:30
@rvncerr rvncerr changed the base branch from alice to master November 28, 2018 23:30
@rvncerr rvncerr changed the base branch from master to alice November 28, 2018 23:35
@rvncerr rvncerr changed the base branch from alice to master November 28, 2018 23:35
@abhinavdangeti
Copy link
Member

@rvncerr perhaps you’ll need to rebase your local branch first and then add your changes at the top?

Copy link
Member

@abhinavdangeti abhinavdangeti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

@@ -37,13 +39,19 @@ func TestRegexpStringSearchUpsideDown(t *testing.T) {
}

func TestRegexpSearchScorch(t *testing.T) {
twoDocIndex := initTwoDocScorch()
dir, _ := ioutil.TempDir("", "scorchTwoDoc")
defer os.RemoveAll(dir)
Copy link
Member

@abhinavdangeti abhinavdangeti Nov 29, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errCheck fails on this line, change to:

defer func() {
    _ = os.RemoveAll(dir)
}()

testRegexpSearch(t, twoDocIndex, internalIDMakerScorch, searcherMaker)
_ = twoDocIndex.Close()
}

func TestRegexpStringSearchScorch(t *testing.T) {
twoDocIndex := initTwoDocScorch()
dir, _ := ioutil.TempDir("", "scorchTwoDoc")
defer os.RemoveAll(dir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@rvncerr
Copy link
Contributor Author

rvncerr commented Nov 30, 2018

Commit a4c05f7 did not fix the problem. I have found that test uses InternalID for checking the results, not _id. InternalID are segment-specific and sporadic within the test and we can not predict it, so I switched to _id in my last commit.

Score: 1.916290731874155,
},
},
id2score: make(map[string]float64),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could avoid the adding of entires separately (as in lines 128-130) by initializing the map this way ...

id2score: map[string]float64{
    "1": 1.916290731874155,
}

@abhinavdangeti abhinavdangeti merged commit 367c740 into blevesearch:master Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants