dotnet / crank

Benchmarking infrastructure for applications
MIT License
970 stars 103 forks source link

Job stuck in starting state #728

Closed amorelIM closed 4 months ago

amorelIM commented 4 months ago

Recently I was playing with the hello sample and the local.benchmark.yml. I noticed that if I put an exclamation mark in the readyStateText option, the job get stuck in the starting state and timeout.

Benchmark:

imports:
    - https://raw.githubusercontent.com/dotnet/crank/main/src/Microsoft.Crank.Jobs.Bombardier/bombardier.yml

jobs:
  server:
    sources:
      test-project:
        localFolder: ./crank/samples/hello
        branchOrCommit: main
    project: test-project/hello.csproj
    readyStateText: Application started!

scenarios:
  hello:
    application:
      job: server
    load:
      job: bombardier
      variables:
        serverPort: 5000
        path: /

profiles:
  local:
    variables:
      serverAddress: localhost
    jobs: 
      application:
        endpoints: 
          - http://localhost:5010
      load:
        endpoints: 
          - http://localhost:5010

Command:

crank --config .\local.benchmark.yml --scenario hello --profile local --json results.json --application.options.displayOutput true

Output:

[09:04:23 INF] Processing job 'application' (1) in state Starting
[09:04:23 INF] Job didn't start during the expected delay
sebastienros commented 4 months ago

I noticed that if I put an exclamation mark in the readyStateText option, the job get stuck in the starting state and timeout.

Then don't do it ;) You are telling the agent to wait indefinitely until it outputs Application started! on stdout, which the app will never do.

amorelIM commented 4 months ago

haha alright, I wasn't sure what was the meaning of readyStateText.

Thanks!