bilal-fazlani / commanddotnet

A modern framework for building modern CLI apps
https://commanddotnet.bilal-fazlani.com
MIT License
560 stars 32 forks source link

verify OnRunCompleted waits for pipeline to complete #489

Closed drewburlingame closed 7 months ago

drewburlingame commented 7 months ago

an attempt to verify #488.

@Sibusten can you post a failing test or point to a repo where this is failing? I updated a test that seems to verify OnRunCompleted is called only after the pipeline is executed. I might be missing something.

Sibusten commented 7 months ago

Here's a reproduction of the issue which shows disposal before the command finishes https://github.com/Sibusten/commanddotnet-488-repro 2023-11-27_20-57-24

If you change the command in the test to async Task Do and await the Task.Delay you should see the issue. Right now the test is not waiting for the delay to finish because that task is not being awaited.