Project

General

Profile

« Previous | Next » 

Revision c32ce5fc

Added by Eregon (Benoit Daloze) almost 8 years ago

Do not change Encoding.default_internal in assert_raise_with_message

  • It is not thread-safe: if two threads call it concurrently,
    the default_internal Encoding might not be restored, which causes
    many problems. The same applies for $VERBOSE, which might also not be
    restored to its original value but to the new value instead.
    This happens because reading the original value might capture the
    value already changed by EnvUtil.with_default_internal in another
    Thread. One solution could be to capture the value of these globals
    before running the test.
  • Reverts part of r54522.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e