fix(corporate): align runtime timestamps and require database-ready pilots
Deploy Canina / deploy (push) Failing after 1s

This commit is contained in:
Canina Automation committed 2026-10-28 13:08:29 +00:00
1 parent b642833b8b
commit 94f08b8c8a
4 files changed
+40 -7

No files matched your search

+15 -4
View File
@@ -11,14 +11,22 @@ import urllib.request
import corporate_runtime as r
def pilot_environment(environ):
# Idempotency is scoped to authenticated subject: fresh keys alone are not
# enough when the disposable database is retained between manual runs.
return dict(environ, CORPORATE_API_KEY=secrets.token_hex(32),
CORPORATE_QA_API_KEY=secrets.token_hex(32),
CORPORATE_PILOT_RUN_ID=secrets.token_hex(16),
CORPORATE_TEST_DATABASE_URL='postgresql://hermes@127.0.0.1:55441/corporate_test')
def main():
root = Path(__file__).resolve().parent.parent
scratch = Path(os.environ['CORPORATE_PILOT_DIR']).resolve()
if not str(scratch).startswith('/opt/data/cache/scratch/'):
raise ValueError('Scratch pilot output required')
scratch.mkdir(parents=True, exist_ok=True, mode=0o700)
env = dict(os.environ, CORPORATE_API_KEY=secrets.token_hex(32), CORPORATE_QA_API_KEY=secrets.token_hex(32),
CORPORATE_TEST_DATABASE_URL='postgresql://hermes@127.0.0.1:55441/corporate_test')
env = pilot_environment(os.environ)
server = subprocess.Popen(['node', str(root/'scripts/corporate_pilot_server.cjs')], env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
base = 'http://127.0.0.1:55442/api/admin/hermes'
transcript = []
@@ -91,8 +99,11 @@ def main():
'transcript':str(scratch/'transcript.json')}))
finally:
server.terminate()
try: server.communicate(timeout=10)
except subprocess.TimeoutExpired: server.kill();server.communicate()
try: output, _ = server.communicate(timeout=10)
except subprocess.TimeoutExpired:
server.kill()
output, _ = server.communicate()
(scratch/'server.log').write_bytes(output)
if __name__=='__main__': main()