use shorter sleep, tolerate slight execution date disagreements between exchange and bank in auditor
This commit is contained in:
parent
e0979ecf5e
commit
1e685a0241
@ -40,6 +40,14 @@
|
||||
*/
|
||||
#define GRACE_PERIOD GNUNET_TIME_UNIT_HOURS
|
||||
|
||||
/**
|
||||
* How much do we allow the bank and the exchange to disagree about
|
||||
* timestamps? Should be sufficiently large to avoid bogus reports from deltas
|
||||
* created by imperfect clock synchronization and network delay.
|
||||
*/
|
||||
#define TIME_TOLERANCE GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, \
|
||||
15)
|
||||
|
||||
|
||||
/**
|
||||
* Information we keep for each supported account.
|
||||
@ -874,15 +882,34 @@ wire_out_cb (void *cls,
|
||||
}
|
||||
goto cleanup;
|
||||
}
|
||||
if (roi->details.execution_date.abs_value_us !=
|
||||
date.abs_value_us)
|
||||
|
||||
{
|
||||
report (report_row_minor_inconsistencies,
|
||||
json_pack ("{s:s, s:I, s:s}",
|
||||
"table", "wire_out",
|
||||
"row", (json_int_t) rowid,
|
||||
"diagnostic", "execution date missmatch"));
|
||||
struct GNUNET_TIME_Relative delta;
|
||||
|
||||
if (roi->details.execution_date.abs_value_us >
|
||||
date.abs_value_us)
|
||||
delta = GNUNET_TIME_absolute_get_difference (date,
|
||||
roi->details.execution_date);
|
||||
else
|
||||
delta = GNUNET_TIME_absolute_get_difference (roi->details.execution_date,
|
||||
date);
|
||||
if (delta.rel_value_us > TIME_TOLERANCE.rel_value_us)
|
||||
{
|
||||
char *details;
|
||||
|
||||
GNUNET_asprintf (&details,
|
||||
"execution date missmatch (%s)",
|
||||
GNUNET_STRINGS_relative_time_to_string (delta,
|
||||
GNUNET_YES));
|
||||
report (report_row_minor_inconsistencies,
|
||||
json_pack ("{s:s, s:I, s:s}",
|
||||
"table", "wire_out",
|
||||
"row", (json_int_t) rowid,
|
||||
"diagnostic", details));
|
||||
GNUNET_free (details);
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
free_roi (NULL,
|
||||
|
@ -46,7 +46,7 @@ function pre_audit () {
|
||||
do
|
||||
echo -n "."
|
||||
wget http://localhost:8082/ -o /dev/null -O /dev/null >/dev/null && break
|
||||
sleep 1
|
||||
sleep 0.1
|
||||
done
|
||||
echo " DONE"
|
||||
|
||||
@ -63,7 +63,7 @@ function audit_only () {
|
||||
# Run the auditor!
|
||||
echo -n "Running audit(s) ..."
|
||||
taler-auditor -r -c $CONF -m $MASTER_PUB > test-audit.json 2> test-audit.log || exit_fail "auditor failed"
|
||||
|
||||
echo -n "."
|
||||
taler-wire-auditor -r -c $CONF -m $MASTER_PUB > test-wire-audit.json 2> test-wire-audit.log || exit_fail "wire auditor failed"
|
||||
echo " DONE"
|
||||
}
|
||||
@ -73,12 +73,14 @@ function audit_only () {
|
||||
function post_audit () {
|
||||
kill `jobs -p` || true
|
||||
|
||||
echo -n "TeXing ..."
|
||||
echo -n "TeXing ."
|
||||
../../contrib/render.py test-audit.json test-wire-audit.json < ../../contrib/auditor-report.tex.j2 > test-report.tex || exit_fail "Renderer failed"
|
||||
|
||||
echo -n "."
|
||||
timeout 10 pdflatex test-report.tex >/dev/null || exit_fail "pdflatex failed"
|
||||
echo -n "."
|
||||
timeout 10 pdflatex test-report.tex >/dev/null
|
||||
echo "DONE"
|
||||
echo " DONE"
|
||||
}
|
||||
|
||||
|
||||
@ -711,7 +713,7 @@ run_audit
|
||||
echo -n "Testing hung refresh detection... "
|
||||
|
||||
HANG=`jq -er .refresh_hanging[0].amount < test-audit.json`
|
||||
TOTAL_HANG=`jq -e .total_refresh_hanging < test-audit.json`
|
||||
TOTAL_HANG=`jq -er .total_refresh_hanging < test-audit.json`
|
||||
if test x$HANG != x$TOTAL_HANG
|
||||
then
|
||||
exit_fail "Hanging amount inconsistent, got $HANG and $TOTAL_HANG"
|
||||
|
Loading…
Reference in New Issue
Block a user