Epic: improve unit test coverage in pageserver #3667
Labels
a/tech_debt
Area: related to tech debt
c/storage/pageserver
Component: storage: pageserver
c/storage
Component: storage
t/Epic
Issue type: Epic
Milestone
Motivation
Mainly we have integration tests written in python. These tests are suitable for complex scenarios that involve many components, but fall short when you need to test on a module basis. Currently we dont have much unit tests. Adding new ones is quite hard for scenarios that involve playing with actual data (for example actual storage implementation).
Unit tests have a shorter feedback loop and can be run significantly faster than integration tests that involve many processes. They also facilitate better onboarding experience for new engineers since its way easier to understand whats going on in unit test compared to integration tests where a failure can be caused by any component and we have a lot of moving parts there.
There are some smoke tests for storage in https://github.com/neondatabase/neon/blob/main/pageserver/src/tenant.rs#L2913 but this is not enough. This doesnt excersize gc and compaction paths.
Other aspects like tenant relocation are only covered in integration tests. Tests for eviction and ondemand download require
DoD
All major components have their test suite that is found sufficient. Is it ok to measure by code coverage? Its not ideal, but can be helpful. See list of components and modules in task list.
Implementation ideas
Take areas one by one, analyze ideas for testing, apply needed refactorings for ease of testing, write tests.
For some cases tools like proptest can be useful.
Tasks
List to be continued, feel free to add areas that you feel are not tested enough
Other related tasks and Epics
The text was updated successfully, but these errors were encountered: