This repository was archived by the owner on Sep 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
contrib/opencensus-ext-azure
opencensus/ext/azure/common Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ def _check_storage_size(self):
196196 if size >= self .max_size :
197197 logger .warning (
198198 "Persistent storage max capacity has been "
199- "reached. Currently at %fKB . Telemetry will be "
199+ "reached. Currently at %sKB . Telemetry will be "
200200 "lost. Please consider increasing the value of "
201201 "'storage_max_size' in exporter config." ,
202202 format (size / 1024 )
Original file line number Diff line number Diff line change @@ -151,6 +151,16 @@ def test_check_storage_size_error(self):
151151 os_mock .return_value = True
152152 self .assertTrue (stor ._check_storage_size ())
153153
154+ def test_check_storage_size_above_max_limit (self ):
155+ input = (1 , 2 , 3 )
156+ with LocalFileStorage (os .path .join (TEST_FOLDER , 'asd5' ), 1 ) as stor :
157+ with mock .patch ('os.path.getsize' ) as os_mock :
158+ os_mock .return_value = 52000000
159+ stor .put (input )
160+ with mock .patch ('os.path.islink' ) as os_mock :
161+ os_mock .return_value = True
162+ self .assertFalse (stor ._check_storage_size ())
163+
154164 def test_maintenance_routine (self ):
155165 with mock .patch ('os.makedirs' ) as m :
156166 LocalFileStorage (os .path .join (TEST_FOLDER , 'baz' ))
You can’t perform that action at this time.
0 commit comments