Skip to content

Commit

Permalink
fix(scripts): Divergence artifact for xsnap-trace diff
Browse files Browse the repository at this point in the history
Always generate an artifact, possibly empty if no divergence
  • Loading branch information
mhofman committed Aug 26, 2022
1 parent 687a17b commit ab6d9fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions scripts/process-integration-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ clean_slog() {

"$thisdir/process-integration-swingstore-traces.sh" "$RESULTSDIR"

[ -f "$RESULTSDIR/divergent_snapshots" ] || exit 0
# [ -f "$RESULTSDIR/divergent_snapshots" ] || exit 0

cd "$RESULTSDIR"

Expand Down Expand Up @@ -99,7 +99,9 @@ for v in validator0-xsnap-trace/v*; do
done
done | grep -v "No newline at end of file" > monitor-vs-validator-xsnap-trace.diff || true
[ "x${DEBUG-}" = "x1" ] && set -x
to_backup="$to_backup monitor-vs-validator-xsnap-trace.diff"
grep -e '^--- validator' <(cat validator-xsnap-trace.diff monitor-vs-validator-xsnap-trace.diff) | cut -d '/' -f 2 | uniq > divergent_xsnap_trace_vats || true

to_backup="$to_backup monitor-vs-validator-xsnap-trace.diff divergent_xsnap_trace_vats"

mkdir -p "xs-snapshots"
cp -a validator0-xs-snapshots/* "xs-snapshots/" || true
Expand All @@ -118,7 +120,7 @@ for trace in chain-*-swingstore-trace validator*-swingstore-trace; do
to_delete="$to_delete $snapshots_dir"
for v in $({ grep -E 'set local\.v[0-9]+\.lastSnapshot' $trace || true; } | cut -d ' ' -f 2 | cut -d '.' -f 2 | sort | uniq ); do
mkdir -p $snapshots_dir/$v
if grep -q -e "^$v\$" divergent_snapshot_vats; then
if grep -q -e "^$v\$" <(cat divergent_snapshot_vats divergent_xsnap_trace_vats); then
to_backup="$to_backup $snapshots_dir/$v"
v_divergent=1
else
Expand Down Expand Up @@ -146,7 +148,7 @@ for trace in *-xsnap-trace; do
for v in $trace/v*; do
[ -h "$v" ] || continue
v=${v#"$trace/"}
if grep -q -e "^$v\$" divergent_snapshot_vats; then
if grep -q -e "^$v\$" <(cat divergent_snapshot_vats divergent_xsnap_trace_vats); then
v_divergent=1
to_backup="$to_backup $trace/$v $trace/$(readlink $trace/$v)"
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/process-integration-swingstore-traces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if [ -f $RESULTSDIR/chain-stage-0-swingstore-trace ] ; then
diffs="$diffs $RESULTSDIR/monitor-vs-validator-swingstore-trace.diff"
fi

[ $val_diff_ret -eq 0 -a $chain_diff_ret -eq 0 ] && exit 0
# [ $val_diff_ret -eq 0 -a $chain_diff_ret -eq 0 ] && exit 0

get_snapshots_from_diff <(cat $diffs) > $RESULTSDIR/divergent_snapshots
get_vats_from_diff <(cat $diffs) > $RESULTSDIR/divergent_snapshot_vats

0 comments on commit ab6d9fe

Please sign in to comment.