wip: attempt to shorten runtime of test suite#2208
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Copilot
AI
changed the title
perf(tests): speed up test_numerical_errors by shortening schedule horizon
perf(tests): shorten test_numerical_errors schedule horizon from 24h to 4h
May 29, 2026
Copilot created this pull request from a session on behalf of
Flix6x
May 29, 2026 11:55
View session
…db.py Introduces a new `transactional_db` fixture (and its `*_transactional_db` counterparts) that wraps each test in a transaction/savepoint instead of recreating the DB schema from scratch. Migrates `test_sensor_schedules_fresh_db.py` (20 tests) to use this approach, reducing the number of expensive `drop_all + create_all` operations from one-per-test to one-per-module. All 20 tests pass with the new approach. Agent-Logs-Url: https://github.com/FlexMeasures/flexmeasures/sessions/3708b30c-e092-420a-948a-005fbf747bc7 Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fresh_dbfixture pattern and test file structureSession(bind=connection, join_transaction_mode="create_savepoint")works correctlytransactional_dbfixture toflexmeasures/conftest.py*_transactional_dbcounterpart fixtures for all fixtures needed by the test filetest_sensor_schedules_fresh_db.pyto use transactional fixtures (20 tests)