-
Notifications
You must be signed in to change notification settings - Fork 15
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
Allow rollup on deregistered aggregates #1551
Merged
CDimonaco
merged 3 commits into
deregistration
from
rollup_rejecting_on_deregistered_bug
Jun 22, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -914,7 +914,6 @@ defmodule Trento.ClusterTest do | |
commands_to_reject = [ | ||
%CompleteChecksExecution{}, | ||
%DeregisterClusterHost{}, | ||
%RollUpCluster{}, | ||
%SelectChecks{}, | ||
%RegisterClusterHost{} | ||
] | ||
|
@@ -923,6 +922,15 @@ defmodule Trento.ClusterTest do | |
assert match?({:error, :cluster_not_registered}, aggregate_run(initial_events, command)), | ||
"Command #{inspect(command)} should be rejected by the aggregate" | ||
end | ||
|
||
commands_to_accept = [ | ||
%RollUpCluster{} | ||
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. Here we could include the |
||
] | ||
|
||
for command <- commands_to_accept do | ||
assert match?({:ok, _, _}, aggregate_run(initial_events, command)), | ||
"Command #{inspect(command)} should be accepted by a deregistered cluster" | ||
end | ||
end | ||
|
||
test "should emit the HostRemovedFromCluster event after a DeregisterClusterHost command and remove the host from the cluster aggregate state" do | ||
|
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 |
---|---|---|
|
@@ -744,7 +744,6 @@ defmodule Trento.HostTest do | |
commands_to_reject = [ | ||
%DeregisterHost{}, | ||
%RequestHostDeregistration{}, | ||
%RollUpHost{}, | ||
%UpdateHeartbeat{}, | ||
%UpdateProvider{}, | ||
%UpdateSlesSubscriptions{} | ||
|
@@ -753,6 +752,15 @@ defmodule Trento.HostTest do | |
for command <- commands_to_reject do | ||
assert_error(initial_events, command, {:error, :host_not_registered}) | ||
end | ||
|
||
commands_to_accept = [ | ||
%RollUpHost{} | ||
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. The same. We could include the |
||
] | ||
|
||
for command <- commands_to_accept do | ||
assert match?({:ok, _, _}, aggregate_run(initial_events, command)), | ||
"Command #{inspect(command)} should be accepted by a deregistered host" | ||
end | ||
end | ||
|
||
test "should emit the HostDeregistered and HostTombstoned events" do | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
So this does nothing after all 😆
We don't have any command afterward.
Anyway, leave it, maybe we need it in the future