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

Migrate from RR to RSpec Mocks #3066

Merged
merged 2 commits into from Jan 14, 2022
Merged

Migrate from RR to RSpec Mocks #3066

merged 2 commits into from Jan 14, 2022

Conversation

knu
Copy link
Member

@knu knu commented Jan 13, 2022

This closes #3062.

@knu knu requested a review from dsander January 13, 2022 06:35
RSpec-Mocks was found to be extremetly unstable when threads are
heavily involved like this.

Here are some of the errors I saw when I rewrote this spec with rspec-mocks:

```
     Failure/Error:
       raise ActiveRecordError, "Cannot expire connection, " \
         "it is owned by a different thread: #{@owner}. " \
         "Current thread: #{Thread.current}."

     ActiveRecord::ActiveRecordError:
       Cannot expire connection, it is owned by a different thread: #<Thread:0x000055e7f6117798@/home/knu/src/github.com/huginn/huginn/app/concerns/long_runnable.rb:68 run>. Current thread: #<Thread:0x000055e7ee82b2f8 run>.
```

```
free(): double free detected in tcache 2
```

```
     ActiveRecord::StatementInvalid:
       Mysql2::Error::ConnectionError: Lost connection to MySQL server during query
```

```
........F
/home/knu/.config/asdf/installs/ruby/2.6.9/lib/ruby/2.6.0/ripper/sexp.rb:96: [BUG] Segmentation fault at 0x0000000000000000
ruby 2.6.9p207 (2021-11-24 revision 67954) [x86_64-linux]
```
Copy link
Collaborator

@dsander dsander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, thank you! It's a bummer we still need rr for the AgentRunner specs.

@knu knu merged commit 379e074 into master Jan 14, 2022
@knu knu deleted the rspec-mocks branch January 14, 2022 04:13
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

Successfully merging this pull request may close these issues.

Replace RR with RSpec Mocks
2 participants