-
Notifications
You must be signed in to change notification settings - Fork 669
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
Conversation
+ 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.
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 perhaps you’ll need to rebase your local branch first and then add your changes at the top? |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Commit a4c05f7 did not fix the problem. I have found that test uses |
Score: 1.916290731874155, | ||
}, | ||
}, | ||
id2score: make(map[string]float64), |
There was a problem hiding this comment.
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,
}
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.