OpenSlides / OpenSlides/openslides-backend

Fix CountDatastoreCalls

Open
#3,605 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clean up tests
Dominant language
Python
Stars
9
Forks
40
Avg merge
1d 22h
Merged PRs (30d)
19

Description

CountDatastoreCalls now mocks functions of the ExtendedDatabase, which means cache calls are now also checked.
This partially defeats the purpose of the method. The mocker also only looks at some functions. It could be mediated by mocking functions of the DatabaseReader (and maybe -Writer) instead, but I am not sure how far that should go...

Do we want to measure calls to database adapter functions, or are we interested in actual database calls? If it's the latter, it would be necessary to mock the reader/writer functions instead. Maybe taking into account what to do with methods that have the retry_on_db_failure decorator.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CountDatastoreCalls and its current mocking of ExtendedDatabase, then compare that behavior with the DatabaseReader and DatabaseWriter functions mentioned in the issue. Clarify whether the helper should count adapter calls or actual database calls, including methods using retry_on_db_failure; done means the intended scope is agreed and CountDatastoreCalls measures it consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.