Project

General

Profile

Bug #11780

TestIO_Console#test_getpass failed on Solaris

Added by ngoto (Naohisa Goto) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-dev:49412]

Description

Solaris 10 にて、TestIO_Console#test_getpass が以下のエラーで失敗します。

  1) Error:
TestIO_Console#test_getpass:
Errno::EINVAL: Invalid argument
    /XXXXX/test/io/console/test_io_console.rb:190:in `getpass'
    /XXXXX/test/io/console/test_io_console.rb:190:in `block in test_getpass'
    /XXXXX/test/io/console/test_io_console.rb:277:in `helper'
    /XXXXX/test/io/console/test_io_console.rb:185:in `test_getpass'

(r52912 にて確認)

getpass自体は特に問題なく、テストコードのバグだと思います。

まず、m と s の役割が逆の気がします。
たとえば、同ファイル内の test_noecho や test_noecho2 では s.noecho のテストをしていますが、m に対してはecho関係の操作は行なっていません。
getpass は端的に言えば内部で noecho してから gets 相当を行なっているだけと思うので、テストも同様に(test_noecho は簡潔すぎるので)test_noecho2 を元にして書けばよさそうに思いました。

それに加えて、現在のコードでは、Threadとassertのタイミング問題が発生しそうな予感がします。

Associated revisions

Revision 14c46e5f
Added by ngoto (Naohisa Goto) over 3 years ago

  • test/io/console/test_io_console.rb (test_getpass): s.getpass should be tested. Narrow ensure block. This reverts r52911. [Bug #11780] [ruby-dev:49412]

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

Revision 52937
Added by ngoto (Naohisa Goto) over 3 years ago

  • test/io/console/test_io_console.rb (test_getpass): s.getpass should be tested. Narrow ensure block. This reverts r52911. [Bug #11780] [ruby-dev:49412]

Revision 52937
Added by ngoto (Naohisa Goto) over 3 years ago

  • test/io/console/test_io_console.rb (test_getpass): s.getpass should be tested. Narrow ensure block. This reverts r52911. [Bug #11780] [ruby-dev:49412]

Revision 52937
Added by ngoto (Naohisa Goto) over 3 years ago

  • test/io/console/test_io_console.rb (test_getpass): s.getpass should be tested. Narrow ensure block. This reverts r52911. [Bug #11780] [ruby-dev:49412]

Revision 52937
Added by ngoto (Naohisa Goto) over 3 years ago

  • test/io/console/test_io_console.rb (test_getpass): s.getpass should be tested. Narrow ensure block. This reverts r52911. [Bug #11780] [ruby-dev:49412]

Revision 52937
Added by ngoto (Naohisa Goto) over 3 years ago

  • test/io/console/test_io_console.rb (test_getpass): s.getpass should be tested. Narrow ensure block. This reverts r52911. [Bug #11780] [ruby-dev:49412]

Revision 95184065
Added by nobu (Nobuyoshi Nakada) over 3 years ago

test_io_console.rb: separate master and slave

  • test/io/console/test_io_console.rb (test_getpass): separate master side and slave side in each threads. r52937 deadlocked on OS X. [Bug #11780] [ruby-dev:49412]

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

Revision 52939
Added by nobu (Nobuyoshi Nakada) over 3 years ago

test_io_console.rb: separate master and slave

  • test/io/console/test_io_console.rb (test_getpass): separate master side and slave side in each threads. r52937 deadlocked on OS X. [Bug #11780] [ruby-dev:49412]

Revision 52939
Added by nobu (Nobuyoshi Nakada) over 3 years ago

test_io_console.rb: separate master and slave

  • test/io/console/test_io_console.rb (test_getpass): separate master side and slave side in each threads. r52937 deadlocked on OS X. [Bug #11780] [ruby-dev:49412]

Revision 52939
Added by nobu (Nobuyoshi Nakada) over 3 years ago

test_io_console.rb: separate master and slave

  • test/io/console/test_io_console.rb (test_getpass): separate master side and slave side in each threads. r52937 deadlocked on OS X. [Bug #11780] [ruby-dev:49412]

Revision 52939
Added by nobu (Nobuyoshi Nakada) over 3 years ago

test_io_console.rb: separate master and slave

  • test/io/console/test_io_console.rb (test_getpass): separate master side and slave side in each threads. r52937 deadlocked on OS X. [Bug #11780] [ruby-dev:49412]

Revision 52939
Added by nobu (Nobuyoshi Nakada) over 3 years ago

test_io_console.rb: separate master and slave

  • test/io/console/test_io_console.rb (test_getpass): separate master side and slave side in each threads. r52937 deadlocked on OS X. [Bug #11780] [ruby-dev:49412]

History

#1

Updated by ngoto (Naohisa Goto) over 3 years ago

  • Status changed from Open to Closed

Applied in changeset r52937.


  • test/io/console/test_io_console.rb (test_getpass): s.getpass should be tested. Narrow ensure block. This reverts r52911. [Bug #11780] [ruby-dev:49412]

Also available in: Atom PDF