Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9021653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:18:25+00:00 2026-06-16T05:18:25+00:00

I googled for this issue but could not find the answer. My test runs

  • 0

I googled for this issue but could not find the answer.

My test runs appear to run in parallel and cause each other to fail. They do all pass when run individually. I tried to add thread in the test and put them to sleep but no luck.

Is there a way to run these tests in sequence one after another?

My environment:

Visual Studio 2010
Resharper Jet brains 6.1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:18:26+00:00Added an answer on June 16, 2026 at 5:18 am

    I would suggest you have unit tests that are deterministic. That is they don’t depend on the order they are run or that other tests be run before or after. Not doing this is a recipe for failure. Most test runners are based on the fact that test methods are completely independent.

    This fact is inherently obvious in the way the methods of a test class are invoked. e.g. with MS Test you can have Assembly, Class and Test initialize methods. All of these are invoked for each TestMethod being invoked. For example, with the following class:

       [TestClass()]
       public class DivideClassTest
       {
          [AssemblyInitialize()]
          public static void AssemblyInit(TestContext context)
          {
             Console.WriteLine("Assembly Init");
             }
    
          [ClassInitialize()]
          public static void ClassInit(TestContext context)
          {
             Console.WriteLine("ClassInit");
          }
    
          [TestInitialize()]
          public void Initialize()
          {
             Console.WriteLine("TestMethodInit");
          }
    
          [TestCleanup()]
          public void Cleanup()
          {
             Console.WriteLine("TestMethodCleanup");
          }
    
          [ClassCleanup()]
          public static void ClassCleanup()
          {
             Console.WriteLine("ClassCleanup");
          }
    
          [AssemblyCleanup()]
          public static void AssemblyCleanup()
          {
             Console.WriteLine("AssemblyCleanup");
          }
    
          [TestMethod()]
          public void Test1()
          {
              Console.WriteLine("Test1");
          }
          [TestMethod()]
          public void Test2()
          {
              Console.WriteLine("Test2");
          }
      } 
    

    You’ll see output like

    Assembly Init
    ClassInit
    TestMethodInit
    Test1
    TestMethodCleanup
    TestMethodInit
    Test2
    TestMethodCleanup
    ClassCleanup
    AssemblyCleanup
    

    Although there is a “Test” class, the TestMethod itself is considered the test. A “test” class can effectively have many tests.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've searched a lot but could not find any solutions for this. after changing
I googled 2 hours for my issue but still could'nt find any sollution. What
I googled this a little but couldn't find a good result. Right now I'm
I have googled this a little and didn't really find the answer I needed.
I tried Google this issue and was searched over an hour on Stackoverflow, but
I googled this and it seems that no one has an answer, yet it
I checked around, and couldn't find a good answer to this: We have a
I am battling with this issue for a long time, dug around Google and
I am working with Google Python class exercises where I am getting this issue
Edit: closing anchor fixed. This issue exists when testing on the following browsers: Google

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.