Page MenuHomeFeedback Tracker

TestingFramework MyAsyncTest not able to work with async http callbacks
Assigned, NormalPublic

Description

My goal was to use the unit testing framework to write tests for my HTTP api, but I found out that when using an example like the following, the tests never complete.

This is because the game calls bool Asset(), sees that the result is not ready, does whatever, and invokes again and again and again. My log is spammed with "Assert" but my HTTP RestCallback fired of by my framework code never seems to be allowed to invoke. Is it possible that the testing framework invokes the check each game tick before the http client requests are sent / results are processed and exits because it thinks it needs to wait for the next frame?

Has anyone ever tested if these "async" tests truly work? Because while the example code from the TestingFramework.cs MyAsyncTest "works", it is not async at all, it simply has a bunch of blocking calls and do resolve over a few ticks, but I have my doubts if it is actually possible for the game to do any work in between these ticks.

I have attached a full reproduction file ready to copy and paste:

09:51:26.893 SCRIPT : Waiting for results...
09:51:26.894 SCRIPT : Waiting for results...
09:51:26.894 SCRIPT : Waiting for results...
09:51:26.894 SCRIPT : Waiting for results...
09:51:26.894 SCRIPT : Waiting for results...
09:51:26.894 SCRIPT : Waiting for results...
09:51:26.894 SCRIPT : Waiting for results...
09:51:26.894 SCRIPT : Waiting for results...
09:51:26.895 SCRIPT : Waiting for results...
09:51:26.895 SCRIPT : Waiting for results...

Details

Severity
Block
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

Arkensor created this task.Jun 5 2023, 9:53 AM
Geez changed the task status from New to Awaiting internal Testing.Jun 6 2023, 2:47 PM
Geez changed the task status from Awaiting internal Testing to Assigned.