mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 03:13:11 -06:00
Fix broken local DB test
Committing transactions DOES help, who could have foreseen this. Also: expose the PostgreSQL port 5432 to local 15432 via docker-compose file. Please point me to a cleaner solution, as that port-mapping is clearly not required except for testing. Signed-off-by: Maximilian Seifert <max.seifert@drglitch.net>
This commit is contained in:
parent
e58a7c92e9
commit
f6ac51bad6
|
|
@ -158,6 +158,8 @@ services:
|
||||||
POSTGRES_USER: dendrite
|
POSTGRES_USER: dendrite
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
ports:
|
||||||
|
- "15432:5432"
|
||||||
|
|
||||||
zookeeper:
|
zookeeper:
|
||||||
container_name: dendrite_zk
|
container_name: dendrite_zk
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ func Test_sanityCheckOutputRoomEvents(t *testing.T) {
|
||||||
func TestSyncServerDatasource_selectEventsWithEventIDs(t *testing.T) {
|
func TestSyncServerDatasource_selectEventsWithEventIDs(t *testing.T) {
|
||||||
db, err := NewSyncServerDatasource(dataSource)
|
db, err := NewSyncServerDatasource(dataSource)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
|
truncateTable(t, db)
|
||||||
insertTestEvent(t, db)
|
insertTestEvent(t, db)
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
txn, err := db.db.Begin()
|
txn, err := db.db.Begin()
|
||||||
|
|
@ -85,6 +86,9 @@ func TestSyncServerDatasource_selectEventsWithEventIDs(t *testing.T) {
|
||||||
assert.Condition(t, func() bool {
|
assert.Condition(t, func() bool {
|
||||||
return len(events) > 0
|
return len(events) > 0
|
||||||
})
|
})
|
||||||
|
|
||||||
|
err = txn.Commit()
|
||||||
|
assert.Nil(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func insertTestEvent(t *testing.T, db *SyncServerDatasource) {
|
func insertTestEvent(t *testing.T, db *SyncServerDatasource) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue