import unittest,tempfile,json,time,sys,os from pathlib import Path from unittest.mock import patch import numpy as np from s2_tail_diagnostic_math import weights,tail_membership,tail_error,peak_diagnostic from s2_tail_diagnostic import config class TailTests(unittest.TestCase): def test_coordinator_budget_stops_and_reaps_before_worker_cap(self): import s2_tail_diagnostic_guard as guard original_usage=guard.tree_usage def charged_monitor(pid): until=time.process_time()+.04 while time.process_time()