feat: add autonomous YouTube resource recovery and adaptive GGC
Co-authored-by: GPT-6 <gpt-6@openai.com>
This commit is contained in:
1 parent
8826c591dc
commit
b4e1e1e9ca
43 files changed
+5163
-93
No files matched your search
@@ -73,7 +73,9 @@ if name in ('ss-server', 'ss-local'):
|
||||
with (root / 'children').open('a') as f:
|
||||
f.write(str(os.getpid()) + '\n')
|
||||
assert 'SS_PASSWORD' not in os.environ
|
||||
assert sys.argv[1] == '-c' and len(sys.argv) == 3
|
||||
assert sys.argv[1] == '-c'
|
||||
dns = os.environ.get('SS_DNS_SERVER', '') if name == 'ss-server' else ''
|
||||
assert sys.argv[3:] == (['-d', dns] if dns else [])
|
||||
assert (pathlib.Path(sys.argv[2]).stat().st_mode & 0o777) == 0o600
|
||||
log(name)
|
||||
if name == 'ss-local' and scenario in ('ss', 'mixed', 'joinfail') and increment('ss_runs') == 1:
|
||||
@@ -92,6 +94,8 @@ if name == 'zapret2':
|
||||
sys.exit(1)
|
||||
sys.exit(0)
|
||||
assert name == 'autotune'
|
||||
if sys.argv[1:] == ['target-config-check']:
|
||||
sys.exit(0)
|
||||
command = sys.argv[2]
|
||||
if command == 'init':
|
||||
log('init')
|
||||
@@ -140,7 +144,7 @@ elif command == 'monitor':
|
||||
'''
|
||||
|
||||
|
||||
def run(scenario, expected):
|
||||
def run(scenario, expected, dns=''):
|
||||
with tempfile.TemporaryDirectory(prefix='supervision-') as tmp:
|
||||
root = Path(tmp)
|
||||
binary = root / 'bin'
|
||||
@@ -165,7 +169,8 @@ def run(scenario, expected):
|
||||
entry = root / 'entry.sh'
|
||||
entry.write_text(text)
|
||||
env = dict(os.environ, PATH=f'{binary}:{os.environ["PATH"]}', FIXTURE=tmp,
|
||||
SCENARIO=scenario, SS_PASSWORD='ab' * 32, ZAPRET_CONFIG=str(root / 'config'))
|
||||
SCENARIO=scenario, SS_PASSWORD='ab' * 32, SS_DNS_SERVER=dns,
|
||||
ZAPRET_CONFIG=str(root / 'config'))
|
||||
peer = None
|
||||
if scenario == 'orphans':
|
||||
# Local fixture is not PID 1. Adopt orphan workers here so the test
|
||||
@@ -224,6 +229,9 @@ events = run('cancel', 0)
|
||||
assert events.count('start') == 1
|
||||
events = run('prestartfail', 78)
|
||||
assert 'start' not in events and 'stop' not in events
|
||||
for dns in ('8.8.8.8', '2001:4860:4860::8888'):
|
||||
events = run('fatal64', 64, dns)
|
||||
assert events.count('ss-server') == 1 and events.count('ss-local') == 1
|
||||
|
||||
|
||||
def check_watchdog_traps(shell):
|
||||
|
||||
Reference in new issue
Block a user