Merge pull request #9664 from sikachu/master-fix-test_test_failure

Fix test failure introduced in 3ed41e57
debugger does not work on trunk
default the reaping frequency to 10 seconds
Make sure that the test case is run under test env

* Unset $RAILS_ENV that got set by abstract_unit to trigger the default.
* split out environment setting since Ruby 1.9.3 doesn't support inline
  ENV setting.