diff --git a/master/buildbot/test/unit/test_stats_service.py b/master/buildbot/test/unit/test_stats_service.py index 32e4554d88b..4d0d358ddf5 100644 --- a/master/buildbot/test/unit/test_stats_service.py +++ b/master/buildbot/test/unit/test_stats_service.py @@ -55,6 +55,16 @@ def tearDown(self): self.stats_service.stopService() +class DummyStatsStorageBase(StatsStorageBase): + + """ + A dummy class to test intialization of StatsStorageBase. + """ + + def thd_postStatsValue(self, *args, **kwargs): + return defer.succeed(None) + + class TestStatsServicesConfiguration(TestStatsServicesBase): def test_reconfig_with_no_storage_backends(self): @@ -154,6 +164,13 @@ def test_influx_service_not_inited(self): svc.thd_postStatsValue("test", "test", "test") self.assertLogged("Service.*not initialized") + def test_storage_backend_base_failure_on_init(self): + svc = DummyStatsStorageBase() + + r = svc.thd_postStatsValue("test", "test", "test") + assert isinstance(r, defer.Deferred) + assert r.result == None + class TestStatsServicesConsumers(steps.BuildStepMixin, TestStatsServicesBase):