Skip to content

Commit fd2acf7

Browse files
committed
Update task statuses and enhance test runner compatibility
- Marked tasks for improving source code documentation and fixing critical process startup issues as done. - Updated the status of individual failing tests to in-progress. - Refactored test runners in `conftest.py` to use `python3` and absolute paths for better compatibility in container environments. - Added debug logging in `BaseReplicationTest` to improve error handling and visibility during test execution.
1 parent 314477a commit fd2acf7

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

.taskmaster/tasks/tasks.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"id": 2,
1717
"title": "Clean and improve source code documentation",
1818
"description": "Update all docstrings, comments, and inline documentation throughout the codebase",
19-
"status": "in-progress",
19+
"status": "done",
2020
"priority": "medium",
2121
"dependencies": [],
2222
"details": "Systematically review and improve documentation in mysql_ch_replicator/ directory. Focus on: method docstrings, class documentation, inline comments for complex logic, error message clarity, and API documentation. Ensure all public methods have clear docstrings explaining purpose, parameters, and return values.",
@@ -27,7 +27,7 @@
2727
"id": 3,
2828
"title": "Fix critical process startup RuntimeError issues",
2929
"description": "Resolve 'Replication processes failed to start properly' affecting 40+ tests",
30-
"status": "pending",
30+
"status": "done",
3131
"priority": "high",
3232
"dependencies": [
3333
"1"
@@ -69,7 +69,7 @@
6969
"id": 6,
7070
"title": "Fix individual failing tests - Group 1 (Startup/Process)",
7171
"description": "Systematically fix tests failing due to process startup issues",
72-
"status": "pending",
72+
"status": "in-progress",
7373
"priority": "high",
7474
"dependencies": [
7575
"3"
@@ -174,7 +174,7 @@
174174
},
175175
"currentTag": "master",
176176
"description": "Tasks for master context",
177-
"updated": "2025-09-10T15:09:50.837Z"
177+
"updated": "2025-09-10T16:00:30.061Z"
178178
}
179179
}
180180
}

tests/base/base_replication_test.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,22 @@ def start_replication(self, db_name=None, config_file=None):
9090

9191
# Now safe to start replication processes - database exists in MySQL
9292
self.binlog_runner = BinlogReplicatorRunner(cfg_file=actual_config_file)
93-
self.binlog_runner.run()
93+
print(f"DEBUG: Starting binlog runner with command: {self.binlog_runner.cmd}")
94+
try:
95+
self.binlog_runner.run()
96+
print(f"DEBUG: Binlog runner process started successfully: {self.binlog_runner.process}")
97+
except Exception as e:
98+
print(f"ERROR: Failed to start binlog runner: {e}")
99+
raise
94100

95101
self.db_runner = DbReplicatorRunner(db_name, cfg_file=actual_config_file)
96-
self.db_runner.run()
102+
print(f"DEBUG: Starting db runner with command: {self.db_runner.cmd}")
103+
try:
104+
self.db_runner.run()
105+
print(f"DEBUG: DB runner process started successfully: {self.db_runner.process}")
106+
except Exception as e:
107+
print(f"ERROR: Failed to start db runner: {e}")
108+
raise
97109

98110
# CRITICAL: Wait for processes to fully initialize with retry logic
99111
import time

tests/conftest.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,34 @@ def update_test_constants():
118118
# Test runners
119119
class BinlogReplicatorRunner(ProcessRunner):
120120
def __init__(self, cfg_file=CONFIG_FILE):
121-
super().__init__(f"python ./main.py --config {cfg_file} binlog_replicator")
121+
# Use python3 and absolute path for better compatibility in container
122+
import sys
123+
python_exec = sys.executable or "python3"
124+
main_path = os.path.abspath("./main.py")
125+
super().__init__(f"{python_exec} {main_path} --config {cfg_file} binlog_replicator")
122126

123127

124128
class DbReplicatorRunner(ProcessRunner):
125129
def __init__(self, db_name, additional_arguments=None, cfg_file=CONFIG_FILE):
126130
additional_arguments = additional_arguments or ""
127131
if not additional_arguments.startswith(" "):
128132
additional_arguments = " " + additional_arguments
133+
# Use python3 and absolute path for better compatibility in container
134+
import sys
135+
python_exec = sys.executable or "python3"
136+
main_path = os.path.abspath("./main.py")
129137
super().__init__(
130-
f"python ./main.py --config {cfg_file} --db {db_name} db_replicator{additional_arguments}"
138+
f"{python_exec} {main_path} --config {cfg_file} --db {db_name} db_replicator{additional_arguments}"
131139
)
132140

133141

134142
class RunAllRunner(ProcessRunner):
135143
def __init__(self, cfg_file=CONFIG_FILE):
136-
super().__init__(f"python ./main.py --config {cfg_file} run_all")
144+
# Use python3 and absolute path for better compatibility in container
145+
import sys
146+
python_exec = sys.executable or "python3"
147+
main_path = os.path.abspath("./main.py")
148+
super().__init__(f"{python_exec} {main_path} --config {cfg_file} run_all")
137149

138150

139151
# Database operation helpers

0 commit comments

Comments
 (0)