Konstantin Boudnik, sorry, missed it! Ok, so I:
- put in assume instead of assert
- took out the constant USERNAME altogether and changed USER_DIR to "/user/hdfs", since in the same comment you've linked to you mentioned that the test will only work under user hdfs. USERNAME isn't used anywhere except when defining USER_DIR, so I think that makes sense?
- added the user hdfs requirement into the comment above the class
- Does it maybe also make sense to add an assume for the user? Or is it better to allow the test to fail with the appropriate stdout message if its run under the wrong user?
jay vyas, didn't occur to me that there may be cases where the configs are changed (oops), thanks again! I added the requirement to the top comment. But (again, I may be very wrong here) won't the test still work if block rep = 2? Or will that mean that the system won't know which of the two blocks to use – the one that was corrupted or the one that was left untouched? If you're triggering specifically the corrupted one for recovery, wouldn't HDFS be able to restore it from the second replica alone?
Patch attached with mentioned changes, let me know if we should add anything else or change what I've done. Thanks to the both of you!