mytap icon indicating copy to clipboard operation
mytap copied to clipboard

Question: is it possible to use mytap to check deadlock issue?

Open lanphan opened this issue 3 years ago • 5 comments

Hi all,

This project is great to offer the way to unit test SQL. I searched in this project and googled a lot, but still not found how to write mytap test to check deadlock issue, can you give me 1 example about this?

Thanks so much.

lanphan avatar Mar 25 '21 02:03 lanphan

Can you be more specific? Can you describe the issue you want to test?

hepabolu avatar Mar 25 '21 06:03 hepabolu

To be specific, I want to check deadlock caused by gap locking of mysql when simultaneously insert into same table based on different transaction isolation level (REPEATABLE READ vs. READ COMMITTED).

lanphan avatar Mar 25 '21 14:03 lanphan

I am almost sure it's not possible. You had to have an option to perform assertions using more than one connection (or thread) in one time.

You will have to find another solution to use two connections in the same time.

sq6jnx avatar Mar 25 '21 15:03 sq6jnx

Hi @sq6jnx sq, Thanks for your response. This limitation (open only 1 connection) is for myTap only, or for all TAP unit test framework for sql like pgTap also? Do you have any advice about other SQL unit test framework?

Thanks.

lanphan avatar Mar 25 '21 16:03 lanphan

The MyTAP framework uses only the available statements that MySQL provides, i.e. if you can't create a statement that can do what you want, then it cannot be done with the MyTAP framework.

hepabolu avatar Mar 25 '21 21:03 hepabolu