Q:

Alternatives to pending or skip in RSpec 3

There's some tests that sometimes pass, and sometimes fail. I'd like to fix them, but I'm not able to at the moment, for reasons beyond the scope of this question. Are there any alternatives to pending or skip for them in RSpec 3?
pending isn't suitable, because as of the current version of RSpec, when the tests pass, RSpec will tell me that they passed, and therefore shouldn't be marked as pending, and mark the build as broken.
skip isn't suitable. I only use skip to avoid specs that cause the suite to crash. If the tests consistently stop failing, I'd like to know that that's the case.
I'd like something that runs the tests, displays whether it passes or not, but doesn't cause the build to be broken whether they pass or fail.
An additional gem to add this behaviour is ok.

A:

There's nothing built in, but it's trivial to do this yourself:
module AllowFailure
  def allow_failure(reason)
    yield
  rescue Exception => e
    pending(reason)
    raise
  end
end

RSpec.configure do |config|
  config.include AllowFailure
end

Then just wrap the body of the flickering tests with allow_failure(reason) { ... }.
(Caveat: The code above is off-the-cuff and I haven't tried it so it may not be exactly correct -- but it should be close).

