cc-libs/tests/harness/timeout-5s.lua
2026-06-08 05:37:49 +02:00

15 lines
562 B
Lua

-- Harness fixture (NOT auto-discovered: lives under tests/harness/).
-- Sleeps past the 3s libtest default timeout but under the 7s shell watchdog,
-- proving the libtest layer cancels the case first. Driven by `just test-timeout-5s`.
local createLibTest = require('/apis/libtest');
local testlib = createLibTest({ ... });
testlib.test('sleeps past the libtest timeout', function()
testlib.log('about to sleep 5s; libtest should cancel this case at 3s');
sleep(5);
testlib.assertTrue(true); -- never reached: libtest cancels first
end);
testlib.run();