mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-05-13 01:02:37 +02:00
Recent fixes -> release/v2.4 (#891)
* Fix publisher resource leak in librarian submit_document (#883) Wrap pub.start()/pub.send() in try/finally to guarantee pub.stop() is called on error. Remove unnecessary asyncio.sleep(1) kludge. * Make Cassandra replication factor configurable (issue #787) (#887) Add CASSANDRA_REPLICATION_FACTOR environment variable and --cassandra-replication-factor CLI argument to cassandra_config.py. Update all four table store constructors (ConfigTableStore, KnowledgeTableStore, LibraryTableStore, IamTableStore) to accept an optional replication_factor parameter and use it in keyspace creation CQL queries. Thread the replication factor through all service constructors: Configuration, KnowledgeManager, Librarian, IamService, and knowledge store Processor. * Update tests --------- Co-authored-by: gittihub-jpg <rico@springer-mail.net>
This commit is contained in:
parent
fe542b3d33
commit
fd8d5b2c42
21 changed files with 105 additions and 72 deletions
|
|
@ -110,7 +110,8 @@ class TestEndToEndConfigurationFlow:
|
|||
cassandra_host=['kg-host1', 'kg-host2', 'kg-host3', 'kg-host4'],
|
||||
cassandra_username='kg-user',
|
||||
cassandra_password='kg-pass',
|
||||
keyspace='knowledge'
|
||||
keyspace='knowledge',
|
||||
replication_factor=1,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -182,7 +183,8 @@ class TestConfigurationPriorityEndToEnd:
|
|||
cassandra_host=['partial-host'], # From parameter
|
||||
cassandra_username='fallback-user', # From environment
|
||||
cassandra_password='fallback-pass', # From environment
|
||||
keyspace='knowledge'
|
||||
keyspace='knowledge',
|
||||
replication_factor=1,
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
@ -273,7 +275,8 @@ class TestNoBackwardCompatibilityEndToEnd:
|
|||
cassandra_host=['legacy-kg-host'],
|
||||
cassandra_username=None, # Should be None since cassandra_user is not recognized
|
||||
cassandra_password='legacy-kg-pass',
|
||||
keyspace='knowledge'
|
||||
keyspace='knowledge',
|
||||
replication_factor=1,
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
|
@ -367,13 +370,13 @@ class TestMultipleHostsHandling:
|
|||
from trustgraph.base.cassandra_config import resolve_cassandra_config
|
||||
|
||||
# Test various whitespace scenarios
|
||||
hosts1, _, _, _ = resolve_cassandra_config(host='host1, host2 , host3')
|
||||
hosts1, _, _, _, _ = resolve_cassandra_config(host='host1, host2 , host3')
|
||||
assert hosts1 == ['host1', 'host2', 'host3']
|
||||
|
||||
hosts2, _, _, _ = resolve_cassandra_config(host='host1,host2,host3,')
|
||||
hosts2, _, _, _, _ = resolve_cassandra_config(host='host1,host2,host3,')
|
||||
assert hosts2 == ['host1', 'host2', 'host3']
|
||||
|
||||
hosts3, _, _, _ = resolve_cassandra_config(host=' host1 , host2 ')
|
||||
hosts3, _, _, _, _ = resolve_cassandra_config(host=' host1 , host2 ')
|
||||
assert hosts3 == ['host1', 'host2']
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue