Write a slow SQLITE query to test timeout
You should create a user-defined function that sleeps for the desired amount of time.

If you are restricted to build-in mechanisms, try using a recursive common table expression:

WITH RECURSIVE r(i) AS (
  VALUES(0)
  UNION ALL
  SELECT i FROM r
  LIMIT 1000000
)
SELECT i FROM r WHERE i = 1;


But the number of iterations needed for 5 s is strongly dependent on the CPU speed.