-
Notifications
You must be signed in to change notification settings - Fork 121
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
Fixes #224. I believe this is a Postgres only issue #231
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,6 +171,7 @@ GEM | |
|
||
PLATFORMS | ||
arm64-darwin-22 | ||
arm64-darwin-23 | ||
x86_64-darwin-21 | ||
x86_64-darwin-23 | ||
x86_64-linux | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,7 +183,22 @@ class ConcurrencyControlsTest < ActiveSupport::TestCase | |
assert job.reload.ready? | ||
end | ||
|
||
test "verify transactions remain valid after Job creation conflicts via limits_concurrency" do | ||
ActiveRecord::Base.transaction do | ||
SequentialUpdateResultJob.perform_later(@result, name: "A", pause: 0.2.seconds) | ||
SequentialUpdateResultJob.perform_later(@result, name: "B") | ||
|
||
begin | ||
assert_equal 2, SolidQueue::Job.count | ||
assert true, "Transaction state valid" | ||
rescue ActiveRecord::StatementInvalid | ||
assert false, "Transaction state unexpectedly invalid" | ||
end | ||
end | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm... actually, I'm not completely sure if we need this test at all, since it seems it's testing more something internal of Active Record, rather than something we have in Solid Queue 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While this really is more of a test of AR, its value is that we have a confirmation of outcomes with the two different ways to add records to the Semaphore table and we show the two mechanisms "side-by-side". I realized that it was missing an assert to meet that goal. See what you think with the extra line. In the end, if you still feel strongly about cleaning this test up a little, I'll remove it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good! I don't feel strongly about this one 😊 |
||
|
||
private | ||
|
||
def assert_stored_sequence(result, *sequences) | ||
expected = sequences.map { |sequence| "seq: " + sequence.map { |name| "s#{name}c#{name}" }.join } | ||
skip_active_record_query_cache do | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this project I'm following the style of not having a space after
private
when the class has public and private methods, so this one was on purpose 😅