Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test failures caused by Thread trace output #227

Open
boutil opened this issue Aug 20, 2018 · 5 comments
Open

test failures caused by Thread trace output #227

boutil opened this issue Aug 20, 2018 · 5 comments

Comments

@boutil
Copy link

boutil commented Aug 20, 2018

Hi,

When building the package for Debian, the test suite is run. From time to time, a test fails because of the presence of a debug trace, which causes the output to not match the expected result:

Here are two examples of such failures:

Failures:

  1) Parallel.each does not call the finish hook when a start hook fails with threads
     Failure/Error: `METHOD=each WORKER_TYPE=#{type} ruby spec/cases/with_exception_in_start_before_finish.rb 2>&1`.should == '3 called'
     
       expected: "3 called"
            got: "/home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.r... `public_send'\n\tfrom spec/cases/with_exception_in_start_before_finish.rb:21:in `<main>'\n3 called" (using ==)
       Diff:
       @@ -1,2 +1,28 @@
       +/home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `value': No live threads left. Deadlock? (fatal)
       +2 threads, 2 sleeps current:0x000055e6f85ce7c0 main thread:0x000055e6f8243ff0
       +* #<Thread:0x000055e6f8278b68 sleep_forever>
       +   rb_thread_t:0x000055e6f8243ff0 native:0x00007f2e54e99740 int:0
       +   /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `value'
       +   /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `map!'
       +   /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `in_threads'
       +   /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:335:in `work_in_threads'
       +   /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:262:in `map'
       +   /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:217:in `each'
       +   spec/cases/with_exception_in_start_before_finish.rb:21:in `public_send'
       +   spec/cases/with_exception_in_start_before_finish.rb:21:in `<main>'
       +* #<Thread:0x000055e6f8550610@/home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:206 sleep_forever>
       +   rb_thread_t:0x000055e6f85ce7c0 native:0x00007f2e54572700 int:0
       +    depended by: tb_thread_id:0x000055e6f8243ff0
       +   /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:110:in `synchronize'
       +   /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:110:in `next'
       +   /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:338:in `block in work_in_threads'
       +   /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:206:in `block (2 levels) in in_threads'
       +        from /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `map!'
       +        from /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `in_threads'
       +        from /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:335:in `work_in_threads'
       +        from /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:262:in `map'
       +        from /home/boutil/debian/ruby-team/ruby-parallel/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:217:in `each'
       +        from spec/cases/with_exception_in_start_before_finish.rb:21:in `public_send'
       +        from spec/cases/with_exception_in_start_before_finish.rb:21:in `<main>'
        3 called
       
     # ./spec/parallel_spec.rb:524:in `block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:8:in `block (2 levels) in <top (required)>'

Finished in 55.06 seconds (files took 0.21319 seconds to load)
120 examples, 1 failure, 9 pending

Failed examples:

rspec ./spec/parallel_spec.rb[1:9:23] # Parallel.each does not call the finish hook when a start hook fails with threads

or

Failures:

  1) Parallel lambdas runs in threads
     Failure/Error: `ruby spec/cases/with_#{thing}.rb THREADS 2>&1`.should == result

       expected: "ITEM-1\nITEM-2\nITEM-3\n"
            got: "/<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/paral...usr/lib/ruby/vendor_ruby/parallel.rb:262:in `map'\n\tfrom spec/cases/with_queue.rb:18:in `<main>'\n" (using ==)
       Diff:
       @@ -1,4 +1,23 @@
       -ITEM-1
       -ITEM-2
       -ITEM-3
       +/<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `value': No live threads left. Deadlock? (fatal)
       +2 threads, 2 sleeps current:0x000056125940cf40 main thread:0x0000561258fd10d0
       +* #<Thread:0x0000561259004b70 sleep_forever>
       +   rb_thread_t:0x0000561258fd10d0 native:0x00007efd2c062740 int:1
       +   /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `value'
       +   /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `map!'
       +   /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `in_threads'
       +   /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:335:in `work_in_threads'
       +   /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:262:in `map'
       +   spec/cases/with_queue.rb:18:in `<main>'
       +* #<Thread:0x00005612592e8508@/<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:206 sleep_forever>
       +   rb_thread_t:0x000056125940cf40 native:0x00007efd2bb39700 int:0
       +    depended by: tb_thread_id:0x0000561258fd10d0
       +   /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:102:in `synchronize'
       +   /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:102:in `next'
       +   /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:338:in `block in work_in_threads'
       +   /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:206:in `block (2 levels) in in_threads'
       +	from /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `map!'
       +	from /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:207:in `in_threads'
       +	from /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:335:in `work_in_threads'
       +	from /<<PKGBUILDDIR>>/debian/ruby-parallel/usr/lib/ruby/vendor_ruby/parallel.rb:262:in `map'
       +	from spec/cases/with_queue.rb:18:in `<main>'
     # ./spec/parallel_spec.rb:574:in `block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:8:in `block (2 levels) in <top (required)>'

Finished in 47.46 seconds (files took 0.16615 seconds to load)
120 examples, 1 failure, 9 pending

Failed examples:

rspec './spec/parallel_spec.rb[1:13:1]' # Parallel lambdas runs in threads

These traces are certainly not wanted, but maybe the tests should use regexp matches instead of strict equality of strings. What do you think?

@grosser
Copy link
Owner

grosser commented Aug 22, 2018

would prefer that nobody builds packages from this gem ... means more bugs for me + people running old versions without being able to update

@grosser
Copy link
Owner

grosser commented Aug 22, 2018

the errors looks kinda weird ... are they reproducible while running a single test case ?
... I'd guess somehow the system it runs on is limited to very few resources ... not sure ... but I'd prefer to fix that than just sweep it under a rug ... can add a ENV['BUILDING_PACKAGE_IGNORE_TEST'] or so flag to make this green ...

@boutil
Copy link
Author

boutil commented Aug 23, 2018

A couple of packages that Debian ships depend on the parallel gem, so we had to package it too.
I can disable these two tests for now, but the output #<Thread:0x00005612592e8508@/<>... may seem to come from the ruby interpreter, and may appear in other test results, which then could also break.

Would you recommend disabling all tests during build?

@boutil
Copy link
Author

boutil commented Aug 23, 2018

If you want me to run some more tests/debugging, let me know, I would be happy to help.

@grosser
Copy link
Owner

grosser commented Aug 23, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants