-
-
Notifications
You must be signed in to change notification settings - Fork 4
pending and skip do not work in tests that include the reactor context #7
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
Comments
Thanks for reporting this issue. Could you repro on MRI? |
Please make a PR with your repro. |
Hi @ioquatix, |
We're not using async-rspec, but we're using Async and have support code that does much the same thing: run examples inside an async task. This is in line with what @rdubya mentions above. A work-around that seems to work is to copy thead-local storage from current fiber when you enter around_each() and then insert it into the fiber of the async task: # called by rspec when each example is being run
def self.around_each example
thread_local_data = RSpec::Support.thread_local_data
Async do |task|
thread_local_data.each_pair { |key,value| RSpec::Support.thread_local_data[key] = value }
example.run
end
end Calling skip() inside an example now works, but I'm a bit worried whether it could have unintended side-effects. A better solutions is probably needed. |
Yeah that makes sense. We will try to introduce a better way. |
When trying to use
skip
orpending
inside of examples, the examples do not function as expected.skip
results in the call being ignored and the test appearing that it has passed andpending
throws an exception. The following script should be able to be used to reproduce:When I run it I get the following output:
This was ran in the context of a full test suite so there is potentially something else at play, but the basic issue seems to be that
RSpec.current_example
isnil
so it can't be flagged like it should be. The current example is stored on the thread so I'm guessing it has something to do with how the example is being ran in a different thread, but haven't tracked down exactly where the break is.The text was updated successfully, but these errors were encountered: