Skip to content

Add stress testing script for multiple concurrent jobs - #8

Open
AdarshAlex751 wants to merge 1 commit into
mainfrom
alex-branch
Open

Add stress testing script for multiple concurrent jobs#8
AdarshAlex751 wants to merge 1 commit into
mainfrom
alex-branch

Conversation

@AdarshAlex751

Copy link
Copy Markdown
Collaborator

I finished the stress testing script and tested the system with 2, 5, and 10 concurrent jobs. All the jobs were submitted successfully, the worker processes finished without any errors, and the coordinator stayed responsive.

One issue I noticed is that the jobs stayed in the QUEUED state even after the workers completed and notified the coordinator. I didn't change this since it seems to be a coordinator issue and not included in my task.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a standalone stress-test utility script to exercise the DistroML coordinator/worker stack by submitting multiple jobs concurrently, launching local worker processes for each job, polling /api/jobs for status, and emitting logs + a JSON summary report.

Changes:

  • Introduces scripts/stress_test_multiple_jobs.py to submit N jobs concurrently and run N local workers.
  • Adds periodic status polling and a JSON report (latencies, outcomes, per-job details) written to stress_test_logs/.
Suppressed comments (3)

scripts/stress_test_multiple_jobs.py:288

  • If launching one of the workers fails, the script currently aborts before entering the polling try/finally, leaving any already-started worker processes running and their log files open. Consider handling per-worker launch failures by terminating previously-started workers, closing log handles, and returning a non-zero exit code.
    for job in submitted:
        process, log_file = launch_worker(
            job,
            coordinator_url,
            args.steps,
            log_directory,
        )

scripts/stress_test_multiple_jobs.py:379

  • After adding a dedicated cancelled count, include it in the JSON report so the summary matches the printed/exit behavior and doesn't lump cancellations into stuck_or_unknown_jobs.
    report = {
        "requested_jobs": args.jobs,
        "submitted_jobs": len(submitted),
        "submission_failures": submission_errors,
        "completed_jobs": completed,
        "failed_jobs": failed,
        "stuck_or_unknown_jobs": stuck,
        "steps_per_job": args.steps,

scripts/stress_test_multiple_jobs.py:413

  • If cancelled is tracked separately, the script should still exit non-zero when any job is cancelled (since it isn't a successful completion). Update the exit condition to include cancelled == 0.
    return 0 if failed == 0 and stuck == 0 else 1

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +150 to +161
log_path = log_directory / f"{job.name}.log"
log_file = log_path.open("w", encoding="utf-8")

process = subprocess.Popen(
command,
cwd=PROJECT_ROOT,
env=env,
stdout=log_file,
stderr=subprocess.STDOUT,
)

return process, log_file
submission_errors.append(message)
print(f" SUBMISSION FAILED: {message}")

submitted.sort(key=lambda item: item.name)
Comment on lines +400 to +402
report_path = log_directory / (
f"stress_report_{args.jobs}_jobs.json"
)
Comment on lines +350 to +357
completed = sum(
job.final_status == "COMPLETED" for job in submitted
)
failed = sum(
job.final_status == "FAILED" for job in submitted
)
stuck = len(submitted) - completed - failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants