From 67717f74aaf587df16dfe366493e93cd95a26917 Mon Sep 17 00:00:00 2001 From: ashitsalesforce Date: Mon, 30 Dec 2024 09:00:23 -0800 Subject: [PATCH] check if test is running slower than usual check if test is running slower than usual --- .../dataloader/process/CsvProcessTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/java/com/salesforce/dataloader/process/CsvProcessTest.java b/src/test/java/com/salesforce/dataloader/process/CsvProcessTest.java index 28079e02..e85cc509 100644 --- a/src/test/java/com/salesforce/dataloader/process/CsvProcessTest.java +++ b/src/test/java/com/salesforce/dataloader/process/CsvProcessTest.java @@ -36,6 +36,8 @@ import java.util.Map; import java.util.TimeZone; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; @@ -70,7 +72,19 @@ @RunWith(Parameterized.class) @SuppressWarnings("unused") public class CsvProcessTest extends ProcessTestBase { + private static long startTime = 0; + @BeforeClass + public static void setUpBeforeClass() { + startTime = System.currentTimeMillis(); + } + @AfterClass + public static void tearDownAfterClass() { + long endTime = System.currentTimeMillis(); + long elapsedTimeInMinutes = (endTime - startTime) / 60000; + assertTrue("Tests slowed down by more than 1 minute", elapsedTimeInMinutes < 15); + } + public CsvProcessTest(Map config) { super(config); }