All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.S2925.html Maven / Gradle / Ivy

There is a newer version: 8.6.0.37351
Show newest version

Using Thread.sleep in a test is just generally a bad idea. It creates brittle tests that can fail unpredictably depending on environment ("Passes on my machine!") or load.

Noncompliant Code Example

@Test
public void testDoTheThing(){

  MyClass myClass = new MyClass();
  myClass.doTheThing();

  Thread.sleep(500);  // Noncompliant
  // assertions...
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy