Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Unity Test Runner is much slower if Unity is minimized or the screen is locked

Discussion in 'Testing & Automation' started by Revolter, Jun 28, 2019.

  1. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    110
    3 minutes in focus VS 30 min with locked screen on Windows 10
    Unity 2017.4.16
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,257
    I wonder what are your results if you run your tests from the command line.
     
  3. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    110
    also around 3-4 minutes
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,257
    Well, there is a workaround... dont run tests and then minimize :)
     
  5. ElvisAlistar

    ElvisAlistar

    Unity Technologies

    Joined:
    Oct 2, 2013
    Posts:
    223
    @Revolter This sounds very much like something we fixed in later Unity versions. Can you try with the latest Unity 2018 version and let me know if you see the same behaviour?
     
  6. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,283
    This is very visible in 2018.4.2f1. I've got a two-monitor setup, and if I tab to the other monitor, the speed of the progress bar immediately slows down massively.

    I don't quite have the time to test 2018.4.3f1 right now, but unless you think the fix hit in that exact patch, I'd say it still there in 2018.
     
  7. ElvisAlistar

    ElvisAlistar

    Unity Technologies

    Joined:
    Oct 2, 2013
    Posts:
    223
    Please submit a bug report if you haven't done that already. Mention the case number here, so I can follow up on it! Thanks!
     
  8. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,283
    It's a bit hard, it doesn't seem consistent.

    I've only been able to repro it in our full game, not in a repro project, and only sometimes - it seems that it happens when Windows Defender is doing a scan.

    Anyways, that means that it's probably an OS issue? If the system is low on resources, it makes sense that it prioritizes the window that has focus over windows that doesn't.

    The difference is pretty staggering - 10 seconds when Unity has focus, 60 when it doesn't. But, as I said, only reproducible when there's a virus scan going on, and only in one, large project.

    I'm not going to spend any more time trying to create a repro, as this doesn't really affect me that much. But it does for sure happen, it's just hard to tell why and when.

    Here's a gif of it in action. The cancel button has a blue outline when Unity has focus: bug.gif
     
  9. ElvisAlistar

    ElvisAlistar

    Unity Technologies

    Joined:
    Oct 2, 2013
    Posts:
    223
    Yeah, that could be it. Internally some of us are adding our local repo clones, project folders, and related processes as exceptions to Windows Defender so that it never kicks in when we're working with those. Sure, there's some "risk" involved with that, but I think the speed gains we get from it are significant enough that we're willing to take it.
     
  10. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,283
    That's already done. Rider has started giving an option to automatically configure the repo and related files to be excluded by Defender.

    I have tried to exclude Unity, but I can't quite figure out if you're supposed to exclude the app name (Unity) or the executable name (Unity.exe), or the path to the executable or something else. Any insight?
     
  11. ElvisAlistar

    ElvisAlistar

    Unity Technologies

    Joined:
    Oct 2, 2013
    Posts:
    223
    I don't quite know how Defender handles these exclusions. I've excluded both the path and the executable just to be sure.
     
    Baste likes this.