Webhooks return before step output has been uploaded

In our project (https://github.com/vapor/routing/pull/63), we’re trying to use a bot to manually trigger performance tests, and then have the bot report back results once the tests are finished.

Full config file: https://github.com/vapor/routing/blob/4f958918347350c83203b68e41391206556675ee/circle.yml

Webhooks snippet:

notify:
  webhooks:
    - url: https://bot-gh.vapor.codes/circle

When our webhook route gets called, the later steps consistently report that they have output, but don’t provide an output link. Example:

 {
    "name" : "swift test",
    "actions" : [ {
      "truncated" : false,
      "index" : 0,
      "parallel" : true,
      "failed" : null,
      "infrastructure_fail" : null,
      "name" : "swift test",
      "bash_command" : "#!/bin/bash -eo pipefail\nswift test -c release --filter \"RoutingKitTests.RouterPerformanceTests\"",
      "status" : "success",
      "timedout" : null,
      "continue" : null,
      "end_time" : "2019-02-23T15:30:15.659Z",
      "type" : "test",
      "allocation_id" : "5c7166e04d36cd0001615666-0-build/72459225",
      "start_time" : "2019-02-23T15:30:10.176Z",
      "background" : false,
      "exit_code" : 0,
      "insignificant" : false,
      "canceled" : null,
      "step" : 102,
      "run_time_millis" : 5483,
      "has_output" : true
    } ]
  }

As a work around, we’re planning on retrying the build API until the step has output, but any advice is greatly appreciated. Thanks!

Sounds like a race condition between the step ending and the output uploading. I think retrying is the best solution for this case.