cockroachdb / cockroachdb/activerecord-cockroachdb-adapter

Failed test test_multiple_find_or_create_by_within_transactions

Open
#306 0 comments 0 reactions 0 assignees View on GitHub
rails 7.1
Dominant language
Ruby
Stars
105
Forks
56
Avg merge
9h 5m
Merged PRs (30d)
3

Description

Tests:
- CreateOrFindByWithinTransactions#test_multiple_find_or_create_by_bang_within_transactions
- CreateOrFindByWithinTransactions#test_multiple_find_or_create_by_within_transactions

The second thread is running both `ROLLBACK` and `COMMIT` at some point, hence the unwanted error: _no transaction in progress_.

The bug appears at the end of the transaction block ([source](https://github.com/rails/rails/blob/7130e3cfc4a09d76df6e86531bbd6bb95bc081e6/activerecord/test/cases/relations_test.rb#L2495)).

Contributor guide

Open the contributing guide

Research direction

Start with the two named CreateOrFindByWithinTransactions tests and inspect the transaction block in activerecord/test/cases/relations_test.rb at the linked location. Reproduce the concurrent failure and trace the second thread's ROLLBACK and COMMIT calls; done means both tests pass without the “no transaction in progress” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.