-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turn off schedule_to_start activity timeout by default (#119)
- Loading branch information
1 parent
388d9ed
commit be42f00
Showing
2 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'temporal/configuration' | ||
|
||
describe Temporal::Configuration do | ||
describe '#initialize' do | ||
it 'initializes proper default workflow timeouts' do | ||
timeouts = subject.timeouts | ||
|
||
# By default, we don't ever want to timeout workflows, because workflows "always succeed" and | ||
# they may be long-running | ||
expect(timeouts[:execution]).to be >= 86_400 * 365 * 10 | ||
expect(timeouts[:run]).to eq(timeouts[:execution]) | ||
expect(timeouts[:task]).to eq(10) | ||
end | ||
|
||
it 'initializes proper default activity timeouts' do | ||
timeouts = subject.timeouts | ||
|
||
# Schedule to start timeouts are dangerous because there is no retry. | ||
# https://docs.temporal.io/blog/activity-timeouts/#schedule-to-start-timeout recommends to use them rarely | ||
expect(timeouts[:schedule_to_start]).to be(nil) | ||
# We keep retrying until the workflow times out, by default | ||
expect(timeouts[:schedule_to_close]).to be(nil) | ||
# Activity invocations should be short-lived by default so they can be retried relatively quickly | ||
expect(timeouts[:start_to_close]).to eq(30) | ||
# No heartbeating for a default (short-lived) activity | ||
expect(timeouts[:heartbeat]).to be(nil) | ||
end | ||
end | ||
end |