Files
momentry_core/test_debug_loop.py
Warren b54c2def30 feat: add migrations, test scripts, and utility tools
- Add database migrations (006-028) for face recognition, identity, file_uuid
- Add test scripts for ASR, face, search, processing
- Add portal frontend (Tauri)
- Add config, benchmark, and monitoring utilities
- Add model checkpoints and pretrained model references
2026-04-30 15:11:53 +08:00

76 lines
1.6 KiB
Python

#!/usr/bin/env python3
"""Test ASR processor with debug output."""
import sys
import os
import subprocess
import tempfile
import time
# Use a smaller test file first
test_video = "../test_video/BigBuckBunny_320x180.mp4"
if not os.path.exists(test_video):
# Try another file
test_video = "../test_video/big_buck_bunny_480p_h264.mov"
print(f"Testing: {test_video}")
size_gb = os.path.getsize(test_video) / (1024**3)
print(f"Size: {size_gb:.2f} GB")
# Create temp output
temp_dir = tempfile.mkdtemp(prefix="asr_debug_loop_")
output_path = os.path.join(temp_dir, "output.json")
# Use debug version
cmd = [
"/opt/homebrew/bin/python3.11",
"scripts/asr_processor_debug.py",
test_video,
output_path,
"--uuid",
"debug_loop_test",
]
print(f"Running command...")
print(f"Temp dir: {temp_dir}")
# Run with short timeout
timeout = 30
start = time.time()
proc = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)
try:
stdout, stderr = proc.communicate(timeout=timeout)
elapsed = time.time() - start
success = proc.returncode == 0
timeout_hit = False
except subprocess.TimeoutExpired:
elapsed = time.time() - start
success = False
timeout_hit = True
proc.kill()
stdout, stderr = proc.communicate()
print(f"\nElapsed: {elapsed:.1f}s")
print(f"Success: {success}")
print(f"Timeout: {timeout_hit}")
print("\n=== STDERR ===")
print(stderr)
print("\n=== STDOUT ===")
print(stdout)
if os.path.exists(output_path):
print(f"\nOutput file exists: {output_path}")
else:
print(f"\nOutput file does not exist")
print(f"\nTemp directory: {temp_dir}")