Skip to content

Commit 83adecc

Browse files
fix more tests
1 parent 914f175 commit 83adecc

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
lines changed

pioreactor/background_jobs/base.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,7 @@ def logger(self):
101101

102102
def __del__(self):
103103
if self._logger:
104-
for handler in self._logger.handlers[:]:
105-
try:
106-
handler.close()
107-
except Exception:
108-
pass # Don't raise in destructor
109-
try:
110-
self._logger.removeHandler(handler)
111-
except Exception:
112-
pass
104+
self._logger.clean_up()
113105

114106

115107
class PostInitCaller(type):

pioreactor/tests/test_background_job.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ def action_to_do_after_od_reading(self) -> None:
442442
assert len(bucket) > 4, bucket
443443

444444
ODReader._pre_read = []
445+
ODReader._post_read = []
445446

446447

447448
def test_dodging_when_od_reading_stops_first() -> None:

pioreactor/tests/test_stirring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_publish_measured_rpm() -> None:
131131

132132

133133
def test_rpm_isnt_updated_if_there_is_no_rpm_measurement() -> None:
134-
exp = "test_publish_measured_rpm"
134+
exp = "test_rpm_isnt_updated_if_there_is_no_rpm_measurement"
135135

136136
publish(f"pioreactor/{unit}/{exp}/stirring/measured_rpm", None, retain=True)
137137
pause()

pioreactor/utils/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def __enter__(self):
343343
self.cursor = self.conn.cursor()
344344
self.cursor.executescript(
345345
"""
346-
PRAGMA busy_timeout = 30000;
346+
PRAGMA busy_timeout = 5000;
347347
PRAGMA synchronous = 1; -- aka NORMAL, recommended when using WAL
348348
PRAGMA temp_store = 2; -- stop writing small files to disk, use mem
349349
PRAGMA foreign_keys = ON;
@@ -632,7 +632,7 @@ def __init__(self) -> None:
632632
self.conn = sqlite3.connect(db_path, isolation_level=None)
633633
self.conn.executescript(
634634
"""
635-
PRAGMA busy_timeout = 30000;
635+
PRAGMA busy_timeout = 5000;
636636
PRAGMA synchronous = NORMAL;
637637
PRAGMA temp_store = 2;
638638
PRAGMA foreign_keys = ON;

0 commit comments

Comments
 (0)