Description
While working on SOLR-13872 I tried to take advantage of the existing CheckBackupStatus helper class and discovered that just about every aspect of this class is broken and needs fixed:
- doesn't use SolrClient, pulls out it's URL to do a bare HTTP request
- hardcoded assumption of xml - but doesn't parse it just tries to match regexes against it
- almost every usage of this class follows the same broken "loop" pattern that garuntees the test will sleep more then it needs to even after CheckBackupStatus thinks the backup is a success...
CheckBackupStatus checkBackupStatus = new CheckBackupStatus(...); while (!checkBackupStatus.success) { checkBackupStatus.fetchStatus(); Thread.sleep(1000); }
- the 3 arg constructor is broken both in design and in implementation:
- it appears to be useful for checking that a new backup has succeeded after a lastBackupTimestamp from some previously successful check
- in reality it only ever reports success if it's status check indicates the most recent backup has the exact .equals() time stamp as lastBackupTimestamp
- AND THESE TIMESTAMPS ONLY HAVE MINUTE PRECISION
- As far as i can tell, the only the tests using the 3 arg version ever pass is because of the broken loop pattern:
- they ask for the status so quick, it's either already done (during the same wall clock minute) or it's not done yet and they re-read the "old" status (with the old matching timestamp)
- either way, the test then sleeps for a second giving the "new" backup enough time to actually finish
- AFAICT if the System clock ticks over to a new minute in between these sleep calls, the test is garunteed to loop forever!
Everything about this class needs to die and be replaced with something better.
Attachments
Attachments
Issue Links
- relates to
-
SOLR-13872 Backup can fail to read index files w/NoSuchFileException during merges (SOLR-11616 regression)
-
- Closed
-