[Rake-devel] still the same bug in unittest of rake 0.5.4

Lionel Thiry lthiry at skynet.be
Sat Apr 30 20:30:54 EDT 2005


Hello!

The exact same bug is still here in rake-0.5.4.

I worked some on it and I found where it lies.

I changed this part in test/filecreation.rb
----8<----
module FileCreation
   def create_timed_files(oldfile, newfile)
     return if File.exist?(oldfile) && File.exist?(newfile)
     old_time = create_file(oldfile)
     while create_file(newfile) <= old_time
       sleep(0.1)
       File.delete(newfile) rescue nil
     end
   end
  ...
end
----8<----

into

----8<----
module FileCreation
   def create_timed_files(oldfile, newfile)
     return if File.exist?(oldfile) && File.exist?(newfile)
     old_time = create_file(oldfile)
     while create_file(newfile) <= old_time
       sleep(0.1)
       begin
        File.delete(newfile)
       rescue Exception => e
        puts e
       end
     end
   end
  ...
end
----8<----

I then have the following output when running rake test:

----8<----
C:\usr\ruby\lib\ruby\gems\1.8\gems\rake-0.5.4>rake
(in C:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4)
UNABLE TO RUN FUNCTIONAL TESTS
No Session Found
Loaded suite c:/usr/ruby/lib/ruby/gems/1.8/gems/rake-0.5.4/lib/rake/rake_test_lo
ader
Started
EEEEEEEEEEEE...............................................Permission denied - t
estdata/new
Permission denied - testdata/new
Permission denied - testdata/new
Permission denied - testdata/new
Permission denied - testdata/new
Permission denied - testdata/new
Permission denied - testdata/new
Permission denied - testdata/new
Permission denied - testdata/new
Permission denied - testdata/new <ctrl-C pressed here>
./test/filecreation.rb:10:in `sleep': Interrupt
         from ./test/filecreation.rb:10:in `create_timed_files'
         from ./test/testtasks.rb:125:in `test_file_depends_on_task_depend_on_fil
e'
         from c:/usr/ruby/lib/ruby/1.8/test/unit/testcase.rb:70:in `__send__'
         from c:/usr/ruby/lib/ruby/1.8/test/unit/testcase.rb:70:in `run'
         from c:/usr/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run'
         from c:/usr/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `each'
         from c:/usr/ruby/lib/ruby/1.8/test/unit/testsuite.rb:31:in `run'
         from c:/usr/ruby/lib/ruby/1.8/test/unit/testsuite.rb:32:in `run'
          ... 6 levels...
         from c:/usr/ruby/lib/ruby/1.8/test/unit/autorunner.rb:194:in `run'
         from c:/usr/ruby/lib/ruby/1.8/test/unit/autorunner.rb:14:in `run'
         from c:/usr/ruby/lib/ruby/1.8/test/unit.rb:285
         from c:/usr/ruby/lib/ruby/1.8/test/unit.rb:283
Terminer le programme de commandes (O/N) ? O
----8<----

I do not actually understand why the permission is denied.

By the way, if in file_creation.rb I just remove the "rescue nil" after 
File.delete(newfile), there is no more loop problem. But there are a lot of 
"Errno::EACCES: Permission denied - testdata/a.a" and alike (about 41).

If I explore testdata and try some deletion myself, there is nothing wrong. I 
really don't understand. Any clue?

-- 
Lionel Thiry

Personal website: http://users.skynet.be/lthiry/


More information about the Rake-devel mailing list