From 532fabf20a3f9377f1f9526d38e068069a81a922 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 20 Mar 2022 14:50:13 +0100 Subject: add variant of GET /reserves/ testing command with support for long polling (to diagnose reserve long polling issue reported by FD) --- src/include/taler_testing_lib.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/include/taler_testing_lib.h') diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index 829f9b8a..19d1aaa2 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -1383,6 +1383,37 @@ TALER_TESTING_cmd_status (const char *label, unsigned int expected_response_code); +/** + * Create a GET "reserves" command with a @a timeout. + * + * @param label the command label. + * @param reserve_reference reference to the reserve to check. + * @param expected_balance expected balance for the reserve. + * @param timeout how long to long-poll for the reserve to exist. + * @param expected_response_code expected HTTP response code. + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_reserve_poll (const char *label, + const char *reserve_reference, + const char *expected_balance, + struct GNUNET_TIME_Relative timeout, + unsigned int expected_response_code); + + +/** + * Wait for #TALER_TESTING_cmd_reserve_poll() to finish. + * Fail if it did not conclude by the timeout. + * + * @param label our label + * @param poll_reference reference to a #TALER_TESTING_cmd_reserve_poll() command + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_reserve_poll_finish (const char *label, + const char *poll_reference); + + /** * Create a POST "/reserves/$RID/history" command. * -- cgit v1.2.3