Commit 50789a02 authored by Julius Roob's avatar Julius Roob 🐛 Committed by Bernd Lietzow

testing: modsync-early-abort: cleanup and improve error messages.

(cherry picked from commit 3eb8c2259df027708ddcfdb2e9149301333cd1fc)
(cherry picked from commit 59bd5e3d1b17cf5436071ecd4a783628e36db157)
parent 7a96c026
mount = node.properties["client0"]["mount"]
on node do cd mount do
# how long shall the test wait for the resync to start and fail?
timeout = 60
done = false
on node do; cd mount do
shell "for i in `seq 1 10000`; do touch file_$i; done"
end; end
# Create some files to keep resync running long enough for modsync to fail.
shell "for i in `seq 1 10000`; do touch file_$i; done"
parallel do
on node do; cd mount do
# Task that creates work for modsync
sequential do
t1 = Time.now
while Time.now < t1 + timeout and not done do
shell "touch file_1"
sleep 0.1
end
end; end
end
on node do; cd mount do
# Task that starts and tests the resync and modsync abort.
sequential do
shell "sudo #{$binaries[:ctl]} --startresync --nodetype=meta --mirrorgroupid=101"
shell "sudo #{$binaries[:ctl]} --startresync --nodetype=meta --mirrorgroupid=101"
begin
shell "sudo #{$binaries[:ctl]} --startresync --nodetype=meta --mirrorgroupid=101"
wait_daemon_log(node, "meta0", "Modification resync failed.", timeout)
done = true
# wait a moment to make sure the --resyncstats has been updated
sleep 10
# check if resync has actually stopped
raise if not shell? "sudo #{$binaries[:ctl]} --resyncstats --nodetype=meta \
--mirrorgroupid=101 | grep -i \"completed with errors\""
# modsync should fail immediately, so 0 objects synced, 1 error
raise if not shell? "sudo #{$binaries[:ctl]} --resyncstats --nodetype=meta \
--mirrorgroupid=101 | grep -i \"modification objects synced: 0\""
raise if not shell? "sudo #{$binaries[:ctl]} --resyncstats --nodetype=meta \
--mirrorgroupid=101 | grep -i \"modification sync errors: 1\""
rescue
raise "Modification resync was expected to fail and abort immediately but didn't."
end
done = true # Enough modifications done to trigger failure
# wait a moment to make sure the --resyncstats has been updated
sleep 10
end; end
# check if resync has actually stopped
raise "Modification resync did not complete with errors." if
not shell? "sudo #{$binaries[:ctl]} --resyncstats --nodetype=meta \
--mirrorgroupid=101 | grep -i \"completed with errors\""
# modsync should fail immediately, so 0 objects synced, 1 error
raise "Modification resync should not have synced any objects." if
not shell? "sudo #{$binaries[:ctl]} --resyncstats --nodetype=meta \
--mirrorgroupid=101 | grep -i \"modification objects synced: 0\""
raise "Modification resync completed with 0 errors, should have been at least 1." if
shell? "sudo #{$binaries[:ctl]} --resyncstats --nodetype=meta \
--mirrorgroupid=101 | grep -Ei \"modification sync errors: 0\""
end
end
end end # on node cd mount
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment