Skip to content

Commit 6382545

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 c1da367 commit 6382545

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/mysql.test.lua

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

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

0 commit comments

Comments
 (0)