Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug RequiresPlayMode throws Unhandled log message: '[Assert] TLS Allocator ALLOC_TEMP_THREAD

Discussion in 'Testing & Automation' started by Maeslezo, Sep 6, 2022.

  1. Maeslezo

    Maeslezo

    Joined:
    Jun 16, 2015
    Posts:
    255
    Hello,

    I was trying to use the new RequiresPlayMode and it works pretty well.

    Unfortunately I have a problem when I execute the test in batchmode.
    The test fails throwing this error

    Unhandled log message: '[Assert] TLS Allocator ALLOC_TEMP_THREAD, underlying allocator ALLOC_TEMP_THREAD has unfreed allocations, size 192'. Use UnityEngine.TestTools.LogAssert.Expect

    I'll try to report a bug but it's not easy to reproduce.
    it's not urgent because I could workaround transforming the async Task to IEnumerator and moving the tests to playmode.

    Thanks

    This is the test
    Code (CSharp):
    1. using NUnit.Framework;
    2. using System.Threading.Tasks;
    3. using UnityEngine.TestTools;
    4.  
    5. namespace DummyTests
    6. {
    7.  
    8.         [Test]
    9.         [RequiresPlayMode]
    10.         public async Task DummyTest()
    11.         {
    12.             Assert.Pass();
    13.         }
    14. }
    This is the pipeline call:
    Code (CSharp):
    1. & $Unity -batchmode -runTests -logFile - -projectPath $ProjectPath -testResults $testResults -testPlatform EditMode -testSettingsFile $settingFiles -debugCodeOptimization -enableCodeCoverage -coverageResultsPath $coverageResults -coverageOptions $CoverageOptions
    Version:
    Test Framework
    Version 2.0.1-pre.18 - January 24, 2022
     
    Last edited: Sep 6, 2022