TestFSTs.testRealTerms is a terrible unit test [LUCENE-3036]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
This test:
- uses FSDirectory.open (platform-specific behavior)
- is a random test, but runs to a certain amount of seconds, then quits (makes it hard to reproduce with seed, as its behavior is dependent on your computers speed etc)
After waiting 3 hours to download the 1 gigabyte file to reproduce the corrupt index it made in (https://hudson.apache.org/hudson/job/Lucene-trunk/1533/testReport/junit/org.apache.lucene.util.automaton.fst/TestFSTs/testRealTerms/), I found some of this frustrating.
I managed to finally reproduce it but its no fun fiddling with a test that runs for 5 minutes to reproduce a fail.
---
Migrated from [LUCENE-3036](https://issues.apache.org/jira/browse/LUCENE-3036) by Robert Muir (@rmuir), updated Apr 23 2011
Attachments: [LUCENE-3036.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-3036/LUCENE-3036.patch)
Contributor guide
Research direction
Start by reading TestFSTs.testRealTerms and its use of FSDirectory.open, then review the attached LUCENE-3036.patch for the proposed direction. Done means the test no longer depends on platform-specific behavior or a speed-dependent timed run, while still exercising the real-terms case reproducibly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search, testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100