Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Some tests e.g. WorkerSchemaTests don't seem to work standalone due to lack of database preparation #15671

Open
@reivilibre

Description

@reivilibre
 python -m twisted.trial -j 24 tests.storage.test_rollback_worker.WorkerSchemaTests
Running 3 tests.
tests.storage.test_rollback_worker
  WorkerSchemaTests
    test_not_upgraded_current_schema_version_with_outstanding_deltas ... [ERROR]
    test_rolling_back ...                                               [ERROR]
    test_not_upgraded_old_schema_version ...                            [ERROR]

===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/home/rei/work/synapse/tests/unittest.py", line 121, in new
    return code(orig, *args, **kwargs)
  File "/home/rei/work/synapse/tests/unittest.py", line 225, in setUp
    return orig()
  File "/home/rei/work/synapse/tests/unittest.py", line 340, in setUp
    self.hs = self.make_homeserver(self.reactor, self.clock)
  File "/home/rei/work/synapse/tests/storage/test_rollback_worker.py", line 48, in make_homeserver
    hs = self.setup_test_homeserver(
  File "/home/rei/work/synapse/tests/unittest.py", line 608, in setup_test_homeserver
    hs = setup_test_homeserver(self.addCleanup, **kwargs)
  File "/home/rei/work/synapse/tests/server.py", line 921, in setup_test_homeserver
    prepare_database(
  File "/home/rei/work/synapse/synapse/storage/prepare_database.py", line 155, in prepare_database
    raise UpgradeDatabaseException(EMPTY_DATABASE_ON_WORKER_ERROR)
synapse.storage.prepare_database.UpgradeDatabaseException: Uninitialised database: run the main synapse process to prepare the database schema before starting worker processes.

tests.storage.test_rollback_worker.WorkerSchemaTests.test_not_upgraded_current_schema_version_with_outstanding_deltas
tests.storage.test_rollback_worker.WorkerSchemaTests.test_rolling_back
tests.storage.test_rollback_worker.WorkerSchemaTests.test_not_upgraded_old_schema_version
-------------------------------------------------------------------------------

but the tests work when run as a bigger batch.

It seems like there is interaction between the tests, which doesn't seem ideal...

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-TestingIssues related to testing in complement, synapse, etcS-TolerableMinor significance, cosmetic issues, low or no impact to users.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions