From 109d464c76f7add1d7f5cb76ab41db9a9243bfa7 Mon Sep 17 00:00:00 2001 From: Chris Tilt Date: Tue, 29 Jan 2013 20:37:36 -0800 Subject: [PATCH] Fix my refactor error and add some debug --- tests/replication.erl | 2 +- tests/replication_upgrade.erl | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/replication.erl b/tests/replication.erl index 13968129..c3ed10c5 100644 --- a/tests/replication.erl +++ b/tests/replication.erl @@ -167,6 +167,7 @@ replication([AFirst|_] = ANodes, [BFirst|_] = BNodes, Connected) -> ?assertEqual([], do_write(ASecond, 301, 400, TestBucket, 2)), %% verify data is replicated to B + rt:wait_until_pingable(BSecond), lager:info("Reading 101 keys written to ~p from ~p", [ASecond, BSecond]), ?assertEqual(0, wait_for_reads(BSecond, 301, 400, TestBucket, 2)), @@ -254,7 +255,6 @@ replication([AFirst|_] = ANodes, [BFirst|_] = BNodes, Connected) -> lager:info("Nodes restarted"), - case nodes_all_have_version(ANodes, "1.1.0") of true -> diff --git a/tests/replication_upgrade.erl b/tests/replication_upgrade.erl index e884c359..5044b8cc 100644 --- a/tests/replication_upgrade.erl +++ b/tests/replication_upgrade.erl @@ -44,25 +44,32 @@ confirm() -> erlang:exit() end, - lager:info("Upgrading nodes in order: ~p", [NodeUpgrades]), - ClusterASize = rt:config(cluster_a_size, 3), {ANodes, BNodes} = lists:split(ClusterASize, Nodes), lager:info("ANodes: ~p", [ANodes]), lager:info("BNodes: ~p", [BNodes]), lager:info("Build cluster A"), - replication:make_cluster(ANodes), + repl_util:make_cluster(ANodes), lager:info("Build cluster B"), - replication:make_cluster(BNodes), + repl_util:make_cluster(BNodes), + + lager:info("Replication First pass...homogenous cluster"), %% initial replication run, homogeneous cluster replication:replication(ANodes, BNodes, false), + + lager:info("Upgrading nodes in order: ~p", [NodeUpgrades]), + rt:log_to_nodes(Nodes, "Upgrading nodes in order: ~p", [NodeUpgrades]), %% upgrade the nodes, one at a time lists:foreach(fun(Node) -> + lager:info("Upgrade node: ~p", [Node]), + rt:log_to_nodes(Nodes, "Upgrade node: ~p", [Node]), rtdev:upgrade(Node, current), rt:wait_until_pingable(Node), timer:sleep(1000), + lager:info("Replication with upgraded node: ~p", [Node]), + rt:log_to_nodes(Nodes, "Replication with upgraded node: ~p", [Node]), replication:replication(ANodes, BNodes, true) end, NodeUpgrades).