tag1consulting / goose

Load testing framework, inspired by Locust
https://tag1.com/goose
Apache License 2.0
791 stars 70 forks source link

thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', /home/elijah/Projects/goose/src/manager.rs:322:40 #484

Closed ElijahLynn closed 2 years ago

ElijahLynn commented 2 years ago

I'm sorting through docs figuring out getting goose running, and I've had success getting it working without manager mode, but when I do manager mode, I get this error:

thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', /home/elijah/Projects/goose/src/manager.rs:322:40

❯ cargo run --example simple --release --features gaggle -- --host http://example.com --manager --expect-workers 2                 
    Finished release [optimized] target(s) in 0.20s                                                                                
     Running `/home/elijah/Projects/goose/target/release/examples/simple --host 'http://example.com' --manager --expect-workers 2` 
22:59:32 [INFO] Output verbosity level: INFO                                                                                       
22:59:32 [INFO] Logfile verbosity level: WARN                                                                                      
22:59:32 [INFO] users defaulted to number of CPUs = 8                                                                              
22:59:32 [INFO] expect_workers = 2                                                                                                 
22:59:32 [INFO] manager_bind_host = 0.0.0.0                                                                                        
22:59:32 [INFO] manager_bind_port = 5115                                                                                           
22:59:32 [INFO] global host configured: http://example.com                                                                         
22:59:32 [INFO] allocating transactions and scenarios with RoundRobin scheduler                                                    
22:59:32 [INFO] preparing users for Workers...                                                                                     
22:59:32 [INFO] manager listening on tcp://0.0.0.0:5115, waiting for 2 workers                                                     
22:59:32 [INFO] each worker to start 4 users                                                                                       
thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', /home/elijah/Projects/goose/src/manager.rs:322:40
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace                                                      

The code is here but I'm new to Rust and don't understand it yet:

https://github.com/tag1consulting/goose/blob/fa0c462f1557c70d4ab09b66c54d0993abbb5965/src/manager.rs#L322-L329

jeremyandrews commented 2 years ago

Sorry for the hassle. This is fixed in https://github.com/tag1consulting/goose/pull/477 -- if you set --run-time you can work around the bug until the next release.

For example:

cargo run --example simple --release --features gaggle -- --host http://example.com --manager --expect-workers 2 --run-time 1h
jeremyandrews commented 2 years ago

Please run cargo update and use Goose 0.16.2 (which was just released) -- this bug is now fixed. Thanks for reporting the problem!

ElijahLynn commented 2 years ago

Please run cargo update and use Goose 0.16.2 (which was just released) -- this bug is now fixed. Thanks for reporting the problem!

That worked and it started listening for the workers and I was able to launch two workers that connected and then the Gaggle started!

16:28:46 [INFO] manager listening on tcp://0.0.0.0:5115, waiting for 2 workers 
16:28:46 [INFO] each worker to start 12 users, assigning 1 extra to 1 workers  
16:29:53 [INFO] worker 1 of 2 connected                                        
16:29:53 [INFO] serializing users with serde_cbor...                           
16:29:53 [INFO] sending 13 users to worker 1                                   
16:30:04 [INFO] worker 2 of 2 connected                                        
16:30:04 [INFO] serializing users with serde_cbor...                           
16:30:04 [INFO] sending 12 users to worker 2                                   
16:30:04 [INFO] gaggle distributed load test started                           

Next step (not this issue) is to figure out how how to have each user request as much as possible, currently it feels like there is a throttle and I'm only seeing 1-2 req/s with two workers (static html on www.example.com).