On 6/10/24 4:01 PM, Kirill A. Korinsky wrote:
ports@

I discovered that make test for net/synapse doesn't work, all tests fail.

Thus, tests seems to be leaked and it consumes near 8G of RAM before it was
killed due to hit the hard limit on my system.

To avoid that I had added pytest-forked to run each test in dedicated
process that allows to limit memory consumption to 200-300 mb,
thsu, py-test-forked had missed dependecy to py-py which is known issue:
https://github.com/pytest-dev/pytest-forked/issues/88


That's OK for me, but if you find a way so that it passes psql tests too, like Landry@ suggested, that would be nice.

Anyway, some tests still fails due to requerement postgresql:

=========================== short test summary info ============================
FAILED 
tests/app/test_openid_listener.py::FederationReaderOpenIDListenerTests::test_openid_listener_0
FAILED 
tests/app/test_openid_listener.py::FederationReaderOpenIDListenerTests::test_openid_listener_1
FAILED 
tests/app/test_openid_listener.py::FederationReaderOpenIDListenerTests::test_openid_listener_2
FAILED 
tests/app/test_openid_listener.py::FederationReaderOpenIDListenerTests::test_openid_listener_3
FAILED 
tests/replication/test_federation_ack.py::FederationAckTestCase::test_federation_ack_sent
FAILED 
tests/storage/test_rollback_worker.py::WorkerSchemaTests::test_not_upgraded_current_schema_version_with_outstanding_deltas
FAILED 
tests/storage/test_rollback_worker.py::WorkerSchemaTests::test_not_upgraded_old_schema_version
FAILED 
tests/storage/test_rollback_worker.py::WorkerSchemaTests::test_rolling_back
FAILED 
tests/storage/test_room_search.py::EventSearchInsertionTest::test_null_byte
FAILED tests/storage/test_room_search.py::MessageSearchTest::test_sqlite_search
ERROR tests/federation/transport/server/test__base.py::test_disconnect
ERROR tests/http/test_servlet.py::test_disconnect
ERROR tests/replication/http/test__base.py::test_disconnect
ERROR tests/test_server.py::test_disconnect
= 10 failed, 2816 passed, 302 skipped, 196 warnings, 4 errors in 2082.83s 
(0:34:42) =

So, here the diff:

diff --git net/synapse/Makefile net/synapse/Makefile
index 14d1308402c..54a2525ab69 100644
--- net/synapse/Makefile
+++ net/synapse/Makefile
@@ -71,11 +71,19 @@ RUN_DEPENDS +=      www/py-requests${MODPY_FLAVOR}
  TEST_DEPENDS =        ${FULLPKGNAME}:${BUILD_PKGPATH} \
                devel/py-mock${MODPY_FLAVOR} \
                devel/py-parameterized${MODPY_FLAVOR} \
+               devel/py-test-forked${MODPY_FLAVOR} \
                www/py-jwt${MODPY_FLAVOR}
do-configure:
        @${MODCARGO_configure}
+MODPY_PYTEST_ARGS = --forked tests/
+MODPY_TEST_DIR =       ${WRKDIR}
+
+pre-test:
+       @rm -fr ${WRKDIR}/tests
+       @cp -r ${WRKSRC}/tests ${WRKDIR}/
+
  # to generate rust modules.inc:
  #  make modcargo-gen-crates and modcargo-gen-crates-licenses
  .include "modules.inc"

diff --git devel/py-test-forked/Makefile devel/py-test-forked/Makefile
index 4682cc8931b..37738d5184a 100644
--- devel/py-test-forked/Makefile
+++ devel/py-test-forked/Makefile
@@ -4,7 +4,7 @@ MODPY_EGG_VERSION =     1.6.0
DISTNAME = pytest-forked-${MODPY_EGG_VERSION}
  PKGNAME =             py-test-forked-${MODPY_EGG_VERSION}
-REVISION =             0
+REVISION =             1
CATEGORIES = devel @@ -22,6 +22,7 @@ MODPY_PI = Yes
  MODPY_PYBUILD =               setuptools_scm
  MODPY_PYTEST_ARGS =   -v
-RUN_DEPENDS = devel/py-test${MODPY_FLAVOR}
+RUN_DEPENDS =          devel/py-py${MODPY_FLAVOR} \
+                       devel/py-test${MODPY_FLAVOR}
.include <bsd.port.mk>


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to