Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Rushinko · Nov 13, 2017 at 03:48 PM · testingplaymodetest

Is there a limit to Test Runner play mode test duration?

I'm having an issue with the test runner. My play mode tests only run for a total of 30 seconds. Example: I will be in a for loop for (var i = 0; i <100; i++) with a WaitForSeconds(1); This test should run for 100 seconds, however the test ends after 30 seconds. no matter what parameter i put in the for loop (assuming it will run for over 30 seconds) it continuously ends at 6 seconds.
Does anyone know what's going and how to fix it?

Edit: I am using coroutines with the [Unity Test] attribute:

The code is attatched. link text

testgantry.txt (1.1 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by HaraldNielsen · Nov 13, 2017 at 06:40 PM

Hi, So [UnityTest] actually starts a coroutine executing that method.

For the Test stopping, try to set the TimeOut to something high. It could be it picked up the default one.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Rushinko · Nov 13, 2017 at 06:50 PM 0
Share

I completely forgot about the Timeout Attribute. It worked perfectly. Thank you.

avatar image
0

Answer by bhavinbhai2707 · Nov 13, 2017 at 04:05 PM

waitForSeconds is not a method so it cannot be called directly!! The Correct way for using waitForSeconds is to use it in Couroutines.

 //User Defined Function
     private IEnumerator CoroutineFunction()
     {
             //Statements
             yield return new WaitForSeconds(1f);
     }

Correct way for Doing Your Problem is

 void Start () {
         StartCoroutine(CoroutineFunction());
     }
 
     // Update is called once per frame
     private IEnumerator CoroutineFunction()
     {
         for (int i = 0; i < 100; i++)
         {
             Debug.Log(i);
             yield return new WaitForSeconds(1f);
         }
     }
Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Rushinko · Nov 13, 2017 at 04:15 PM 0
Share

I should have clarified, I am using a co-routine. I am also using yield return new WaitForSeconds(1f); The issue persists

avatar image bhavinbhai2707 Rushinko · Nov 13, 2017 at 04:19 PM 0
Share

Can you show us the full code you are using?? Because the above code i gave seems to be working fine!!

avatar image Rushinko bhavinbhai2707 · Nov 13, 2017 at 04:22 PM 0
Share

I just added it to the original post. $$anonymous$$y other coroutines work fine, The issue seems to stem from the Test Runner as far as I can tell

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

73 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to implement mandatory cleanup for the Unity PlayMode tests? 1 Answer

TestRunner playmode IPrebuildSetup test doesn't run 1 Answer

Unity Test Runner doesn't cleanup previous test results 1 Answer

How to load a scene in PlayMode tests 2 Answers

Unity Test Tools - Integration Test for existing scenes 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges