From: Nick Porter Date: Mon, 10 Aug 2026 19:07:28 +0000 (+0100) Subject: Add test for PostgreSQL query being cancelled X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;p=thirdparty%2Ffreeradius-server.git Add test for PostgreSQL query being cancelled --- diff --git a/src/tests/modules/sql_postgresql/timeout.unlang b/src/tests/modules/sql_postgresql/timeout.unlang new file mode 100644 index 0000000000..d18f50c159 --- /dev/null +++ b/src/tests/modules/sql_postgresql/timeout.unlang @@ -0,0 +1,24 @@ +integer gottimeout + +try { + timeout 0.1s { + %sql('SELECT PG_SLEEP(1)') + } +} +catch timeout { + gottimeout := 1 +} + +if (!gottimeout) { + test_fail +} + +# +# Verify that the next query returns correctly. +# +if (%sql('SELECT 1') != 1) { + test_fail +} + +test_pass +