Skip to content

Commit 5bfab0c

Browse files
committed
test: fiber is not blocked by close/execute
Test that concurrent use of `execute` and `close` does not result to infinite blocking. Part of #34
1 parent d466ccf commit 5bfab0c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/mysql.test.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,14 @@ local function test_block_fiber_inf(test, pool, conn)
559559
return false
560560
end
561561
test:ok(is_cancelled() == false, 'fiber is not blocked (pool conn)')
562+
563+
-- Start the first fiber.
564+
fiber.create(conn.execute, conn, 'SELECT sleep(0.01)')
565+
-- Start the second fiber.
566+
fiber.create(test_fiber_block_long_request, conn)
567+
-- Start the third fiber.
568+
fiber.create(conn.close, conn)
569+
test:ok(is_cancelled() == false, 'fiber is not blocked (non pool conn)')
562570
end
563571

564572
local test = tap.test('mysql connector')

0 commit comments

Comments
 (0)