X-Git-Url: https://git.liburcu.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Frotation%2Frotate_utils.sh;fp=tests%2Fregression%2Ftools%2Frotation%2Frotate_utils.sh;h=146f7e25cc529fa0023b6ecfbac5f485418f3fcb;hp=8ac2afab7aeefbf4644d205ec61a88e251e65079;hb=609996d5eafa3c5fb62924f4acb3813b00264e18;hpb=2545db87957d24f43e2e2d5c49bb56b31bb9180a diff --git a/tests/regression/tools/rotation/rotate_utils.sh b/tests/regression/tools/rotation/rotate_utils.sh index 8ac2afab7..146f7e25c 100644 --- a/tests/regression/tools/rotation/rotate_utils.sh +++ b/tests/regression/tools/rotation/rotate_utils.sh @@ -150,15 +150,22 @@ function trace_until_n_archives () local produce_events=$1 local trace_path=$2 local target_archive_count=$3 + local trace_size_cutoff=$4 local archive_count=0 + local trace_size=0 diag "Waiting for $target_archive_count size-based rotations to occur" - while [[ archive_count -lt $target_archive_count ]] + while [[ archive_count -lt $target_archive_count && $trace_size -lt $trace_size_cutoff ]] do archive_count=$(find "$trace_path" -mindepth 2 -maxdepth 2 -type d -path "*archives*" | wc -l) + trace_size=$(du -b "$trace_path" | tail -n1 | cut -f1) $produce_events 2000 done + if [[ $trace_size -ge $trace_size_cutoff ]]; then + diag "Exceeded size cutoff of $trace_size_cutoff bytes while waiting for $target_archive_count rotations" + fi + [[ $archive_count -eq $target_archive_count ]] ok $? "Found $target_archive_count trace archives resulting from trace archive rotations" }