The c_test was sometimes failing with an assertion.
The c_test was sometimes failing with an assertion.

Summary:
On fast filesystems (e.g. /dev/shm and ext4), the flushing
of memstore to disk was fast and quick, and the background compaction
thread was not getting scheduled fast enough to delete obsolete
files before the db was closed. This caused the repair method
to pick up those files that were not part of the db and the unit
test was failing.

The fix is to enhance the unti test to run a compaction before
closing the database so that all files that are not part of the
database are truly deleted from the filesystem.

Test Plan: make c_test; ./c_test

Reviewers: chip, emayanke, sheki

Reviewed By: chip

CC: leveldb

Differential Revision: https://reviews.facebook.net/D6915

virtdb/rocksdb,rDSN-Projects/rocksdb.replicated,facebook/rocksdb,geraldoandradee/rocksdb,msb-at-yahoo/rocksdb,dkorolev/rocksdb,vmx/rocksdb,dkorolev/rocksdb,virtdb/rocksdb,alihalabyah/rocksdb,jalexanderqed/rocksdb,kaschaeffer/rocksdb,SunguckLee/RocksDB,sorphi/rocksdb,biddyweb/rocksdb,JoeWoo/rocksdb,OverlordQ/rocksdb,tsheasha/rocksdb,ylong/rocksdb,Andymic/rocksdb,ryneli/rocksdb,vashstorm/rocksdb,sorphi/rocksdb,vmx/rocksdb,hobinyoon/rocksdb,RyanTech/rocksdb,virtdb/rocksdb,msb-at-yahoo/rocksdb,fengshao0907/rocksdb,wenduo/rocksdb,ryneli/rocksdb,flabby/rocksdb,alihalabyah/rocksdb,Andymic/rocksdb,vmx/rocksdb,tschottdorf/rocksdb,vashstorm/rocksdb,wlqGit/rocksdb,Vaisman/rocksdb,vmx/rocksdb,tsheasha/rocksdb,SunguckLee/RocksDB,wenduo/rocksdb,msb-at-yahoo/rocksdb,wskplho/rocksdb,biddyweb/rocksdb,JohnPJenkins/rocksdb,Applied-Duality/rocksdb,rDSN-Projects/rocksdb.replicated,JohnPJenkins/rocksdb,flabby/rocksdb,wenduo/rocksdb,alihalabyah/rocksdb,Applied-Duality/rocksdb,biddyweb/rocksdb,fengshao0907/rocksdb,IMCG/RcoksDB,temicai/rocksdb,geraldoandradee/rocksdb,sorphi/rocksdb,flabby/rocksdb,luckywhu/rocksdb,wlqGit/rocksdb,siddhartharay007/rocksdb,sorphi/rocksdb,ryneli/rocksdb,zhangpng/rocksdb,NickCis/rocksdb,mbarbon/rocksdb,wenduo/rocksdb,wlqGit/rocksdb,makelivedotnet/rocksdb,JoeWoo/rocksdb,facebook/rocksdb,lgscofield/rocksdb,tschottdorf/rocksdb,temicai/rocksdb,ylong/rocksdb,norton/rocksdb,anagav/rocksdb,rDSN-Projects/rocksdb.replicated,wat-ze-hex/rocksdb,jalexanderqed/rocksdb,amyvmiwei/rocksdb,siddhartharay007/rocksdb,OverlordQ/rocksdb,norton/rocksdb,amyvmiwei/rocksdb,makelivedotnet/rocksdb,rDSN-Projects/rocksdb.replicated,SunguckLee/RocksDB,mbarbon/rocksdb,JoeWoo/rocksdb,temicai/rocksdb,bbiao/rocksdb,bbiao/rocksdb,siddhartharay007/rocksdb,SunguckLee/RocksDB,norton/rocksdb,JoeWoo/rocksdb,norton/rocksdb,tizzybec/rocksdb,skunkwerks/rocksdb,vashstorm/rocksdb,temicai/rocksdb,JackLian/rocksdb,zhangpng/rocksdb,bbiao/rocksdb,zhangpng/rocksdb,flabby/rocksdb,IMCG/RcoksDB,RyanTech/rocksdb,JohnPJenkins/rocksdb,IMCG/RcoksDB,Applied-Duality/rocksdb,bbiao/rocksdb,IMCG/RcoksDB,skunkwerks/rocksdb,IMCG/RcoksDB,RyanTech/rocksdb,OverlordQ/rocksdb,vmx/rocksdb,JackLian/rocksdb,tsheasha/rocksdb,tsheasha/rocksdb,wat-ze-hex/rocksdb,NickCis/rocksdb,mbarbon/rocksdb,lgscofield/rocksdb,anagav/rocksdb,tsheasha/rocksdb,hobinyoon/rocksdb,wenduo/rocksdb,mbarbon/rocksdb,makelivedotnet/rocksdb,geraldoandradee/rocksdb,RyanTech/rocksdb,luckywhu/rocksdb,biddyweb/rocksdb,Applied-Duality/rocksdb,mbarbon/rocksdb,alihalabyah/rocksdb,IMCG/RcoksDB,jalexanderqed/rocksdb,skunkwerks/rocksdb,ryneli/rocksdb,amyvmiwei/rocksdb,geraldoandradee/rocksdb,skunkwerks/rocksdb,anagav/rocksdb,flabby/rocksdb,biddyweb/rocksdb,caijieming-baidu/rocksdb,SunguckLee/RocksDB,ylong/rocksdb,tizzybec/rocksdb,Applied-Duality/rocksdb,geraldoandradee/rocksdb,alihalabyah/rocksdb,anagav/rocksdb,wenduo/rocksdb,RyanTech/rocksdb,kaschaeffer/rocksdb,flabby/rocksdb,JackLian/rocksdb,Andymic/rocksdb,JackLian/rocksdb,bbiao/rocksdb,OverlordQ/rocksdb,jalexanderqed/rocksdb,wlqGit/rocksdb,JackLian/rocksdb,kaschaeffer/rocksdb,NickCis/rocksdb,amyvmiwei/rocksdb,temicai/rocksdb,tizzybec/rocksdb,skunkwerks/rocksdb,wskplho/rocksdb,SunguckLee/RocksDB,NickCis/rocksdb,Andymic/rocksdb,JackLian/rocksdb,anagav/rocksdb,tschottdorf/rocksdb,JoeWoo/rocksdb,zhangpng/rocksdb,dkorolev/rocksdb,wat-ze-hex/rocksdb,ryneli/rocksdb,wskplho/rocksdb,OverlordQ/rocksdb,Andymic/rocksdb,norton/rocksdb,hobinyoon/rocksdb,tsheasha/rocksdb,Andymic/rocksdb,bbiao/rocksdb,siddhartharay007/rocksdb,Andymic/rocksdb,lgscofield/rocksdb,msb-at-yahoo/rocksdb,anagav/rocksdb,amyvmiwei/rocksdb,tizzybec/rocksdb,ylong/rocksdb,SunguckLee/RocksDB,luckywhu/rocksdb,Vaisman/rocksdb,wat-ze-hex/rocksdb,dkorolev/rocksdb,flabby/rocksdb,facebook/rocksdb,tizzybec/rocksdb,OverlordQ/rocksdb,kaschaeffer/rocksdb,tizzybec/rocksdb,lgscofield/rocksdb,NickCis/rocksdb,geraldoandradee/rocksdb,tschottdorf/rocksdb,rDSN-Projects/rocksdb.replicated,wskplho/rocksdb,msb-at-yahoo/rocksdb,hobinyoon/rocksdb,Vaisman/rocksdb,luckywhu/rocksdb,rDSN-Projects/rocksdb.replicated,virtdb/rocksdb,JohnPJenkins/rocksdb,vmx/rocksdb,caijieming-baidu/rocksdb,JoeWoo/rocksdb,NickCis/rocksdb,fengshao0907/rocksdb,fengshao0907/rocksdb,temicai/rocksdb,bbiao/rocksdb,makelivedotnet/rocksdb,makelivedotnet/rocksdb,Applied-Duality/rocksdb,siddhartharay007/rocksdb,RyanTech/rocksdb,tsheasha/rocksdb,wat-ze-hex/rocksdb,anagav/rocksdb,norton/rocksdb,JohnPJenkins/rocksdb,makelivedotnet/rocksdb,caijieming-baidu/rocksdb,wenduo/rocksdb,sorphi/rocksdb,facebook/rocksdb,temicai/rocksdb,facebook/rocksdb,jalexanderqed/rocksdb,alihalabyah/rocksdb,caijieming-baidu/rocksdb,kaschaeffer/rocksdb,norton/rocksdb,geraldoandradee/rocksdb,caijieming-baidu/rocksdb,zhangpng/rocksdb,facebook/rocksdb,JoeWoo/rocksdb,wat-ze-hex/rocksdb,Vaisman/rocksdb,vashstorm/rocksdb,lgscofield/rocksdb,kaschaeffer/rocksdb,ryneli/rocksdb,amyvmiwei/rocksdb,NickCis/rocksdb,RyanTech/rocksdb,SunguckLee/RocksDB,mbarbon/rocksdb,vashstorm/rocksdb,luckywhu/rocksdb,hobinyoon/rocksdb,facebook/rocksdb,wlqGit/rocksdb,virtdb/rocksdb,JackLian/rocksdb,hobinyoon/rocksdb,dkorolev/rocksdb,sorphi/rocksdb,wat-ze-hex/rocksdb,vmx/rocksdb,vashstorm/rocksdb,wskplho/rocksdb,lgscofield/rocksdb,ylong/rocksdb,norton/rocksdb,ylong/rocksdb,virtdb/rocksdb,fengshao0907/rocksdb,sorphi/rocksdb,fengshao0907/rocksdb,alihalabyah/rocksdb,OverlordQ/rocksdb,tschottdorf/rocksdb,luckywhu/rocksdb,caijieming-baidu/rocksdb,tschottdorf/rocksdb,tsheasha/rocksdb,rDSN-Projects/rocksdb.replicated,fengshao0907/rocksdb,jalexanderqed/rocksdb,amyvmiwei/rocksdb,lgscofield/rocksdb,biddyweb/rocksdb,wat-ze-hex/rocksdb,JohnPJenkins/rocksdb,mbarbon/rocksdb,siddhartharay007/rocksdb,zhangpng/rocksdb,Applied-Duality/rocksdb,wlqGit/rocksdb,makelivedotnet/rocksdb,Vaisman/rocksdb,jalexanderqed/rocksdb,tizzybec/rocksdb,Andymic/rocksdb,dkorolev/rocksdb,msb-at-yahoo/rocksdb,IMCG/RcoksDB,vmx/rocksdb,zhangpng/rocksdb,facebook/rocksdb,JohnPJenkins/rocksdb,caijieming-baidu/rocksdb,Vaisman/rocksdb,siddhartharay007/rocksdb,wskplho/rocksdb,biddyweb/rocksdb,hobinyoon/rocksdb,vashstorm/rocksdb,wskplho/rocksdb,dkorolev/rocksdb,skunkwerks/rocksdb,wenduo/rocksdb,ryneli/rocksdb,hobinyoon/rocksdb,luckywhu/rocksdb,bbiao/rocksdb,Vaisman/rocksdb,ylong/rocksdb,kaschaeffer/rocksdb,virtdb/rocksdb,wlqGit/rocksdb,skunkwerks/rocksdb