SvenskaSpel / locust-swarm

A tool for launching distributed locust runs on a set of load generators
Apache License 2.0
88 stars 11 forks source link

Setting PYTHONUNBUFFERED=1 doesn't work with csh #25

Open stevereads opened 1 month ago

stevereads commented 1 month ago

I'd like to run swarm, because my use case is running a load test from a number of machines that I connect to via ssh. So I'd use swarm to ssh to each client, launch a test, and target a machine in the same datacenter rack as the clients.

It's out of my control, but all the machines in that datacenter default to using csh. So when I run swarm, it fails with this error:

PYTHONUNBUFFERED=1: Command not found.

I think that's because swarm.py contains this line:

    extra_env = ["PYTHONUNBUFFERED=1"]

, which then gets picked up in cmd. That's how bash and friends set an environment variable for the duration of one command, but it's not how csh does it. In csh, as I understand it, you have to run

env PYTHONUNBUFFERED=1 [rest of command]

How would I make swarm work with csh? bash exists on the remote box, so if I could do bash [rest of command], that would work. Or I could keep it running in csh, but set the env var in a different way. Is there some way to make this work without modifying swarm.py?

cyberw commented 1 month ago

Hmm... I guess there's no way of changing the default shell for your user to use bash?

I'm not really developing locust-swarm any more (I'm building locust.cloud instead :) so I might mark this repo as archived soon...