PyBitmessage icon indicating copy to clipboard operation
PyBitmessage copied to clipboard

Refactor sqlthread

Open cis-muzahid opened this issue 4 years ago • 7 comments

Refactor sqlthread and add test cases for setting versions and SQL internal function called create_function

cis-muzahid avatar Jul 28 '21 08:07 cis-muzahid

Your sql directories are not python packages and should not contain the empty __init__ modules. If you want to install SQL scripts with the app, put them into the package data: https://github.com/Bitmessage/PyBitmessage/blob/v0.6/setup.py#L137 This doesn't apply to tests, they are not installed, and you may find the files based on os.path.abspath(__file__)

g1itch avatar Aug 09 '21 10:08 g1itch

@g1itch This PR should among other things separate the SQL execution from threads, so that you can run the tests without launching the SQL thread. There is a lot of work and that's why it's taking long.

PeterSurda avatar Aug 09 '21 10:08 PeterSurda

@g1itch This PR should among other things separate the SQL execution from threads, so that you can run the tests without launching the SQL thread. There is a lot of work and that's why it's taking long.

I see. I have no problem with the speed yet. I'm glad to see many line of code deleted in this PR. But I'd prefer to report the strange things, I can see in the code before it got merged. Because I believe we can broke it harder than before. More tests will help to avoid such case.

g1itch avatar Aug 09 '21 10:08 g1itch

By the way, the core test suite reports an interesting issue here: https://buildbot.bitmessage.org/#builders/25/builds/1515

g1itch avatar Aug 09 '21 10:08 g1itch

Fixes #1710

PeterSurda avatar Sep 29 '21 06:09 PeterSurda

check_vacuumed should end at line 229. Line 231 should be moved to parent method, and the while loop that follows should have its own function and also be called from parent.

PeterSurda avatar Sep 29 '21 07:09 PeterSurda

By the way, the core test suite reports an interesting issue here: https://buildbot.bitmessage.org/#builders/25/builds/1515

This has been fixed now, as most of the other things you pointed out. It should be ready for you to review in a couple of days, I'll let you know.

PeterSurda avatar Oct 08 '21 06:10 PeterSurda