Skip to content
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

test: fix test_network_disconnect_during_migration #4378

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions tests/dragonfly/cluster_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,8 +1433,7 @@ async def test_migration_with_key_ttl(df_factory):
assert await nodes[1].client.execute_command("stick k_sticky") == 0


@pytest.mark.skip("Flaky test")
@dfly_args({"proactor_threads": 4, "cluster_mode": "yes"})
@dfly_args({"proactor_threads": 4, "cluster_mode": "yes", "migration_finalization_timeout_ms": 5})
Copy link
Collaborator

Choose a reason for hiding this comment

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

you change here the migration_finalization_timeout_ms default
in this test we check that when we cancel the migration due to disconnect we are restarting the migration again and we wait for the sync status
please explain how finalization timeout affect this and why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if we cancel the migration during finalization we should wait until the timeout is ended, and to prevent 30 seconds of waiting I have changed it to 5

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why dont we break on waiting the finalization? because if the connection is closed so we should return with error while waiting for the migration finalization.

Copy link
Contributor Author

@BorysTheDev BorysTheDev Dec 30, 2024

Choose a reason for hiding this comment

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

we try to reconnect until the timeout happens, but the target node waits for LSN for the previous attempt

async def test_network_disconnect_during_migration(df_factory):
instances = [
df_factory.create(
Expand Down Expand Up @@ -1473,7 +1472,7 @@ async def test_network_disconnect_during_migration(df_factory):
await nodes[0].admin_client.execute_command("DFLYCLUSTER", "SLOT-MIGRATION-STATUS")
)

await wait_for_status(nodes[0].admin_client, nodes[1].id, "SYNC")
await wait_for_status(nodes[0].admin_client, nodes[1].id, "SYNC", 20)
finally:
await proxy.close(task)

Expand Down
Loading