From 5dc6b51e739913b3d23d65d16758b6f9fce21de1 Mon Sep 17 00:00:00 2001 From: shadeofblue Date: Wed, 11 Dec 2019 12:13:58 +0100 Subject: [PATCH] fix force payment concent integration test (#4989) * fix force payment concent integration test * don't send `SystemExit` and `Exit` to sentry in any case * don't try to freeze raven's time calls * fix logging --- golem/ethereum/incomeskeeper.py | 5 +++++ loggingconfig.py | 4 +++- .../nodes/provider/day_backwards.py | 2 +- .../nodes/requestor/day_backwards_dont_pay.py | 2 +- .../playbooks/concent/concent_config_base.py | 10 +++++++++- .../playbooks/concent/force_payment/test_config.py | 1 + 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/golem/ethereum/incomeskeeper.py b/golem/ethereum/incomeskeeper.py index 181ed29819..379542d182 100644 --- a/golem/ethereum/incomeskeeper.py +++ b/golem/ethereum/incomeskeeper.py @@ -208,6 +208,11 @@ def update_overdue_incomes() -> None: return for income in incomes: + logger.debug( + "Marking payment as overdue. sender=%s, amount=%s", + income.wallet_operation.sender_address, + income.wallet_operation.amount, + ) income.wallet_operation.status = \ model.WalletOperation.STATUS.overdue income.wallet_operation.save() diff --git a/loggingconfig.py b/loggingconfig.py index 7fdd7ba292..ae421e037e 100644 --- a/loggingconfig.py +++ b/loggingconfig.py @@ -61,12 +61,14 @@ 'level': 'ERROR', 'class': 'golem.tools.customloggers.SwitchedSentryHandler', 'dsn': 'https://cdf4218c9dd24aa6adeb76ad0c990c9b:e6922bfaff9f49ccaa22ae4e406354aa@talkback.golem.network/2', # noqa pylint: disable=line-too-long + 'ignore_exceptions': ['SystemExit', 'Exit'], }, 'sentry-metrics': { 'level': 'DEBUG', 'class': 'golem.tools.customloggers.SwitchedSentryHandler', 'filters': ['sentry-metrics'], - 'dsn': 'https://d0e50b89f1ef4794a4b7f82b06fbe1e7:1043fecec0db4b818ccf76eb03003d03@talkback.golem.network/5' # noqa pylint: disable=line-too-long + 'dsn': 'https://d0e50b89f1ef4794a4b7f82b06fbe1e7:1043fecec0db4b818ccf76eb03003d03@talkback.golem.network/5', # noqa pylint: disable=line-too-long + 'ignore_exceptions': ['SystemExit', 'Exit'], }, }, 'root': { diff --git a/scripts/node_integration_tests/nodes/provider/day_backwards.py b/scripts/node_integration_tests/nodes/provider/day_backwards.py index b1e7a62ae5..158c03d00b 100644 --- a/scripts/node_integration_tests/nodes/provider/day_backwards.py +++ b/scripts/node_integration_tests/nodes/provider/day_backwards.py @@ -10,5 +10,5 @@ from golemapp import main # noqa: E402 module level import not at top of file -with freezegun.freeze_time(helpers.yesterday(), tick=True): +with freezegun.freeze_time(helpers.yesterday(), tick=True, ignore=['raven']): main() diff --git a/scripts/node_integration_tests/nodes/requestor/day_backwards_dont_pay.py b/scripts/node_integration_tests/nodes/requestor/day_backwards_dont_pay.py index a1a811999e..78071396bb 100644 --- a/scripts/node_integration_tests/nodes/requestor/day_backwards_dont_pay.py +++ b/scripts/node_integration_tests/nodes/requestor/day_backwards_dont_pay.py @@ -13,7 +13,7 @@ from golemapp import main # noqa: E402 module level import not at top of file -with freezegun.freeze_time(helpers.yesterday(), tick=True): +with freezegun.freeze_time(helpers.yesterday(), tick=True, ignore=['raven']): with mock.patch( 'golem.ethereum.paymentprocessor.PaymentProcessor.sendout', mock.Mock(return_value=True), diff --git a/scripts/node_integration_tests/playbooks/concent/concent_config_base.py b/scripts/node_integration_tests/playbooks/concent/concent_config_base.py index 7c4c0e21fd..4be00c4d0a 100644 --- a/scripts/node_integration_tests/playbooks/concent/concent_config_base.py +++ b/scripts/node_integration_tests/playbooks/concent/concent_config_base.py @@ -4,5 +4,13 @@ class ConcentTestConfigBase(TestConfigBase): def __init__(self): super().__init__() - for node_config in self.nodes.values(): + self.enable_concent() + + def enable_concent(self): + node_configs = [] + for n in self.nodes.values(): + node_configs.extend( + n if isinstance(n, list) else [n] + ) + for node_config in node_configs: node_config.concent = CONCENT_STAGING diff --git a/scripts/node_integration_tests/playbooks/concent/force_payment/test_config.py b/scripts/node_integration_tests/playbooks/concent/force_payment/test_config.py index d0a99c013f..f3ee0159c2 100644 --- a/scripts/node_integration_tests/playbooks/concent/force_payment/test_config.py +++ b/scripts/node_integration_tests/playbooks/concent/force_payment/test_config.py @@ -22,3 +22,4 @@ def __init__(self): provider_config, provider_config_2, ] + self.enable_concent()