Search Issue Tracker

By Design

Votes

0

Found in

2019.2.13f1

2019.3

2020.1

2020.1.0a5

Issue ID

1201463

Regression

No

"-quit" CMD argument is not waiting for async operations from Methods with the return type "Task" in batch mode

Scripting

-

Reproduction steps:
1. Run the "AsyncExecute2020.zip" project with these command-line arguments: "-batchmode -executeMethod "Builder.Build" -logFile -projectPath -quit"
2. Open the log
3. Note that "Before" is logged
4. Open "Builder.cs" script
5. Comment "Task Build()"
6. Uncomment "void Build()"
7. Run the "AsyncExecute2020.zip" project with these command-line arguments: "-batchmode -executeMethod "Builder.Build" -logFile -projectPath -quit"
8. Open the log
9. Note that "Before" and "After" is logged

Expected Result: "-quit" CMD argument waits for async operations from Methods with all types in batch mode
Actual Result: "-quit" CMD argument is not waiting for async operations from Methods with the return type "Task" in batch mode

Reproduced with: 2020.1.0a15, 2019.3.0f1, 2019.2.14f1, 2019.2.13f1
Did not reproduce on(Feature not yet implemented): 2019.2.12f1, 2019.2.10f1, 2019.2.0f1, 2019.2.0a1, 2019.1.14f1, 2018.4.13f1, 2017.4.35f1

  1. Resolution Note (2020.1.X):

    -executeMethod does not support methods with a return type other than void and 0 argument and this also applies to async methods. This hasn't been enforced with an error, but we have added this now.

    To use a async method that returns a Task with -executeMethod, you can use call a async void method that calls into the Task.

    public static async Task AsyncTaskBuild()
    {
    // code
    }

    public static async void Build()
    {
    await AsyncTaskBuild();
    }

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.