Project

General

Profile

Actions

Bug #12800

closed

YAMLStoreTest#test_thread_safe hang

Added by znz (Kazuhiro NISHIYAMA) over 7 years ago. Updated over 7 years ago.

Status:
Closed
Target version:
-
[ruby-dev:49821]

Description

lib/yaml/store.rb のテストがなかったので、test/test_pstore.rb を元に test/yaml/test_store.rb を作ってみたところ、YAMLStoreTest#test_thread_safe で止まってしまいました。

原因を調べてみたところ、

  • PStoredef initialize(file, thread_safe = false)
  • YAML::Storedef initialize file_name, yaml_opts = {}

という違いがあるのに YAML::Store で (引数なしもかっこもない) super を呼び出していて、意図せず thread_safe が真になっているからだとわかりました。

r33376 での変更からのようで、yaml_opts も使われなくなっていたので、そのあたりも含めて直しておきます。

Actions #1

Updated by Anonymous over 7 years ago

  • Status changed from Assigned to Closed

Applied in changeset r56291.


fix YAML::Store

  • lib/yaml/store.rb (YAML::Store#initialize): Fix arguments.
    [ruby-dev:49821] [Bug #12800]

  • test/yaml/test_store.rb: Add tests from test/test_pstore.rb.

  • test/yaml/test_store.rb (YAMLStoreTest#test_with_options): Add options test.

  • lib/yaml/store.rb (YAML::Store#dump): Revert to to_yaml.

  • lib/yaml/store.rb (YAML::Store#empty_marshal_data): Use to_yaml with options.

  • lib/yaml/store.rb (YAML::Store#empty_marshal_checksum): Use CHECKSUM_ALGO.

Updated by znz (Kazuhiro NISHIYAMA) over 7 years ago

  • Description updated (diff)
Actions

Also available in: Atom PDF

Like0
Like0Like0