镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Undefined method `rollback' for nil:NilClass #669

Description

@nicolasrouanne

I'm running around 2000 tests with rspec and ActiveRecord. Every now and then, let's say one out of 5 test suite runs (i.e. 1 out of 10,000 tests), a random test fails with the undefined method 'rollback' for nil:NilClass:

Failure/Error:
  DatabaseCleaner.cleaning do
    example.run
  end

NoMethodError:
  undefined method `rollback' for nil:NilClass

I'm using this configuration (taken from the readme)

DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions