Motohiro KOSAKI <kosaki.motohiro / gmail.com> wrote:
> 
> > diff --git a/test/-ext-/old_thread_select/test_old_thread_select.rb b/test/-ext-/old_thread_select/test_old_thread_select.rb
> > index 1ccdb34..a8a0ce2 100644
> > --- a/test/-ext-/old_thread_select/test_old_thread_select.rb
> > +++ b/test/-ext-/old_thread_select/test_old_thread_select.rb
> > @@ -16,10 +16,10 @@ class TestOldThreadSelect < Test::Unit::TestCase
> >    def test_old_select_read_timeout
> >      with_pipe do |r, w|
> >        t0 = Time.now
> > -      rc = IO.old_thread_select([r.fileno], nil, nil, 0.001)
> > +      rc = IO.old_thread_select([r.fileno], nil, nil, 0.01)
> >       diff = Time.now - t0
> >        assert_equal 0, rc
> > -      assert diff >= 0.001, "returned too early"
> > +      assert_operator diff, :>=, 0.004, "returned too early: diff=#{diff}"

> No, I really dislike this. both 0.01 and 0.004 make no sense and no
> good reason we choose them.  I guess 0.004 mean 250Hz. But in fact,
> only several linux systems use 250Hz. No platform independent
> meanings.

Yes I used 0.004 to mean 250Hz.  250Hz is/was the default for a long
time, but dynticks got introduced.

> Instead, I just recommend to skip this test if platform is too old linux.
> (I guess our chkbuild caught the same issue, http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20110919T060500Z.log.html.gz)

OK, new patch on the way.

> In addition, the correct way is, to detect inaccurate select timeout
> by configure script and do_select() retry to call select(2)
> automatically _if_ we really need to care.

I don't care enough for this, too much effort for an old platform.