A Two Month Debugging Story
kev.inburke.com
A Two Month Debugging Story
1–10 of 45 posts
Re: A Two Month Debugging Story
#2If it were me I'd want to take the problem somewhere I _could_ get root access and debug it properly. So I'd be interested to know what value this (unnamed) CI platform provides to make it worth a wild goose chase.
Re: A Two Month Debugging Story
#3I had found waterline's load time to have a LOT of things that I hadn't expected and take a long time... I'm just using knex now. Every time I try for magical solutions, I keep regretting it and end up using less magic.
Re: A Two Month Debugging Story
#4Re: A Two Month Debugging Story
#5I realize this wasn't their solution, but it's worth noting that generally speaking, disabling auto-vacuum isn't recommended. Even if you do, it will still force vacuum jobs to prevent transaction ID wraparound.
* https://www.postgresql.org/docs/9.5/static/routine-vacuuming...
Re: A Two Month Debugging Story
#6Oof - seems like you're running on a managed platform that can't be debugged in a reasonable level of detail? If it were me I'd want to take the problem somewhere I _could_ get root access and debug it properly. So I'd be interested to know what value this (unnamed) CI platform provides to make it worth a wild goose chase.
Test technology surely doesn't need that level of secret sauce that you need a hosted service - after two months I'd definitely want another way of doing it.
Re: A Two Month Debugging Story
#7If the above works, automate it.
Re: A Two Month Debugging Story
#8The proposed solution to manually nuke the database state seems crazy to me. Some alternatives:
1. Run the entire test in a transaction, do flushes and assert as normal. At the end, ROLLBACK instead of COMMIT and now you have a pristine database again. [1]
2. Setup pristine DB state once and then use `CREATE DATABASE ... WITH TEMPLATE ...` to create a temporary database. Not sure what the perf hit is, but it's probably worth trying. [2]
[1] http://alextechrants.blogspot.ca/2013/08/unit-testing-sqlalc...
[2] https://www.postgresql.org/docs/9.4/static/manage-ag-templat... CREATE DATABASE actually works by copying an existing database. By default, it copies the standard system database named template1.
Re: A Two Month Debugging Story
#9Re: A Two Month Debugging Story
#10Where possible, I like to have data that can exist independent of the other data on the system. I can make a separate 'tennant' for that test - and just ensure it's wiped before I proceed. Sort of a multi-tennant approach. Works great. I don't bother with a 'teardown', but do any cleanup before the test runs. I also ensure the tests are written to not make assumptions about global state.
Instead of dropping all constraints as the article suggested (that sounds hacky), I use ON DELETE CASCADE constraints. If I miss some, the tests fail. Seems easy enough to maintain.
With the above approach, DB testing is approachable and still pretty quick.