Comments (8)
It looks like sleep 0.1
was not enough in one of the agent tests. I am thinking that we should probably remove all the sleep based tests in favor of explicit waiting on events and such. In Agent
case most of the sleep calls could be replaces by agent.await
.
from concurrent-ruby.
another
1) Concurrent::Runnable instance #run! creates a new thread
Failure/Error: Thread.should_receive(:new).with(no_args()).and_return(t)
(<Thread (class)>).new(no args)
expected: 1 time with no arguments
received: 5 times with no arguments
# ./spec/concurrent/runnable_spec.rb:159:in `Concurrent'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-mocks-2.14.6/lib/rspec/mocks/error_generator.rb:144:in `__raise'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-mocks-2.14.6/lib/rspec/mocks/error_generator.rb:48:in `raise_expectation_error'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-mocks-2.14.6/lib/rspec/mocks/message_expectation.rb:259:in `generate_error'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-mocks-2.14.6/lib/rspec/mocks/message_expectation.rb:215:in `verify_messages_received'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-mocks-2.14.6/lib/rspec/mocks/method_double.rb:205:in `verify'
# org/jruby/RubyArray.java:1613:in `each'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-mocks-2.14.6/lib/rspec/mocks/method_double.rb:205:in `verify'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-mocks-2.14.6/lib/rspec/mocks/proxy.rb:112:in `verify'
# org/jruby/RubyArray.java:1613:in `each'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-mocks-2.14.6/lib/rspec/mocks/proxy.rb:112:in `verify'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-mocks-2.14.6/lib/rspec/mocks/space.rb:14:in `verify_all'
# org/jruby/RubyHash.java:1382:in `each_value'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-mocks-2.14.6/lib/rspec/mocks/space.rb:13:in `verify_all'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-mocks-2.14.6/lib/rspec/mocks.rb:18:in `verify'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/mocking/with_rspec.rb:18:in `verify_mocks_for_rspec'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example.rb:307:in `verify_mocks'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example.rb:299:in `run_after_each'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example.rb:120:in `run'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example.rb:112:in `run'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example.rb:254:in `with_around_each_hooks'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example.rb:111:in `run'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example.rb:109:in `run'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:390:in `run_examples'
# org/jruby/RubyArray.java:2409:in `map'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:386:in `run_examples'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:371:in `run'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:369:in `run'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:372:in `run'
# org/jruby/RubyArray.java:2409:in `map'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:372:in `run'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:369:in `run'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:28:in `run'
# org/jruby/RubyArray.java:2409:in `map'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:28:in `run'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/reporter.rb:58:in `report'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:25:in `run'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:80:in `run'
# /usr/local/var/lib/rbenv/versions/jruby-1.7.12/lib/ruby/gems/shared/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:17:in `autorun'
from concurrent-ruby.
another can be found at https://travis-ci.org/jdantonio/concurrent-ruby/builds/25938067, I may have caused some of them. I was trying to fix it (at least some), but I am out of time. I would suggest to postpone the 0.6 release until we hunt them down.
from concurrent-ruby.
We'll work on the brittle specs for 0.7.0. This is a holiday weekend in the US (Memorial Day is Monday) so I have many family activities planned. We've been fixing brittle specs as we find them. We have a high degree of confidence that it's the tests and not the code so I don't think we need to push too hard to fix them all this weekend or to continue holding off 0.6.0.
from concurrent-ruby.
Generally speaking, sleep based test are not a great idea, even if sometimes are the only way to check if a thread is sleeping or dead.
Our suite is becoming also really slow, mostly due to sleeps. In #16 we were discussing about stress tests and we implemented ImmediateExecutor
to run some kinds of test without concurrency, this way it is possible to highlight easily issues with locks and deadlocks.
For the next release we could start thinking a more coherent way to write tests
from concurrent-ruby.
A better approach could be to terminate/kill everything naturally after each test and test that there are no threads hanging. It could be useful to object-ify any global states we have in the gem into a single object holding it, like ActorWorld in Akka, allowing creation of more concurrent-ruby worlds. We could have a file e.g. concurrent/global which would crete single global world for convenience, but we would not be limited to that. This would also allow us to run tests concurrently which should be possible with gem calling itself concurrent-ruby ;)
from concurrent-ruby.
from concurrent-ruby.
- https://travis-ci.org/ruby-concurrency/concurrent-ruby/jobs/27997662
- https://travis-ci.org/ruby-concurrency/concurrent-ruby/jobs/27997663
- https://travis-ci.org/ruby-concurrency/concurrent-ruby/jobs/28070742
- https://travis-ci.org/ruby-concurrency/concurrent-ruby/jobs/28074869
- https://travis-ci.org/ruby-concurrency/concurrent-ruby/jobs/28074871
from concurrent-ruby.
Related Issues (20)
- why use wait_for_termination method will stuck the code HOT 2
- DaemonThreadFactory creating new Java thread factory each time it creates a new thread HOT 8
- `Concurrent::Promises::Future#value!` can return `nil` even when promise is not resolved yet HOT 6
- Version 1.2.2 crashes with Segmentation fault HOT 3
- Fiber.new causes SEGV when using Ruby 3.3.0 on Rails 7.1.2 in M1 Mac Docker environment HOT 5
- Segfault in lock_local_var.rb on aarch64 HOT 3
- [REDIRECT] Segfault on Ruby 3.3.0 on linux-aarch64? See https://bugs.ruby-lang.org/issues/20085
- Add new CI job with RUBY_MN_THREADS=1 HOT 4
- Add API to prestart threads in threadpools HOT 4
- Don't know how to build task 'parallel_spec' HOT 2
- Segmentation fault related to concurrent-ruby HOT 4
- Segmentation fault with Ruby 3.3.0 running with Docker HOT 1
- Add keyword arguments to async HOT 1
- ThreadPoolExecutor#shutdown? inconsistency in JRuby and C Ruby HOT 4
- test failure due to "uninitialized constant Concurrent::CAtomicReference" HOT 7
- CAtomicFixnum should probably be a private constant HOT 1
- support re-raising exceptions when shutting down a timertask HOT 4
- v1.2.0 release notes do not mention that RubyThreadLocalVar class was removed HOT 8
- NameError: uninitialized constant Concurrent::RubyThreadLocalVar HOT 1
- The Concurrent::Map default_proc is passed a Concurrent::Hash instead of the Concurrent::Map HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from concurrent-ruby.