Skip to content

Attempt to reduce flakiness of scheduler_test - #686

Merged
rosa merged 1 commit into
rails:mainfrom
p-schlickmann:scheduler-flake
Dec 27, 2025
Merged

rosa merged 1 commit into
rails:mainfrom
p-schlickmann:scheduler-flake

Conversation

@p-schlickmann

Copy link
Copy Markdown
Contributor

Issue: #602

Attempting to fix the latest flake against main


test "starting and stopping a worker emits register_process and deregister_process events" do
StoreResultJob.perform_later(42, pause: SolidQueue.shutdown_timeout + 100.second)
StoreResultJob.perform_later(42, pause: SolidQueue.shutdown_timeout + 15.seconds)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not related to scheduler_test, but I don't think this is ever a good idea, to have a timeout that long 😅

Comment thread test/test_helper.rb

unless self.class.use_transactional_tests
destroy_records
end

@p-schlickmann p-schlickmann Nov 18, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In theory, destroy_records will always run in teardown, even if a test fails.

But I also added it in setup to be extra sure records aren't leaking between tests, if for some reason teardown can't run because of a deadlock or a :KILL signal

@rafael-pissardo rafael-pissardo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💯

@rosa

rosa commented Dec 27, 2025

Copy link
Copy Markdown
Member

Very nice! Sorry for the delay @p-schlickmann, and thanks so much for your continued work on this 🙇🏻‍♀️

@rosa
rosa merged commit d00184a into rails:main Dec 27, 2025
@rosa rosa mentioned this pull request Aug 29, 2026
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.

3 participants