Skip to content

Commit

Permalink
Reduce testing time (#1518)
Browse files Browse the repository at this point in the history
Co-authored-by: Fried Hoeben <[email protected]>
  • Loading branch information
six42 and fhoeben committed Jul 7, 2024
1 parent eab5fab commit 19ac942
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ To test this we run in debug mode and request to start the slim server ourselfs.
Use the property slim.timeout to define how long the test system should wait for the slim client. The default is 10 seconds.
In this test we set it to 1 second.

!| script |
| create page | TestPage | with content | !-
# To run this test interactive don't forget to add at the end "&remote_debug" to the rest test command

!| script |
|create page|TestPage|with content|!-
!define TEST_SYSTEM {SLIM}
!define slim.timeout {1}
!define SLIM_PORT {8099}
!define MANUALLY_START_TEST_RUNNER_ON_DEBUG (true)

-! |
| check | request page | TestPage?test&remote_debug | 200 |
|ensure |content contains |Error connecting to SLiM server on localhost:|
| show collapsed| content |
| check | request page | TestPage?executionLog| 200 |
|ensure | content matches | Time elapsed:.* seconds |
| show collapsed| content |
|check |request page |TestPage?test&remote_debug |200 |
|ensure |content contains|Unable to start test system 'SLIM': fitnesse.slim.SlimError: Error connecting to SLiM server on localhost:|
|show collapsed|content |
|check |request page |TestPage?executionLog |200 |
|ensure |content matches |Time elapsed:.* seconds |
|show collapsed|content |

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
For this test to perform we reduce the timeout to 2 seconds. If the server is not responding in time, we should raise an error.
For this test to perform we reduce the timeout to 1 seconds. If the server is not responding in time, we should raise an error.

#!define slim.flags {-s 12}
#|fitnesse.fixtures.Sleep|20000|

!| script |
!|script |
|given page|TestPage|with content|${SUT_PATH} !-
!define TEST_SYSTEM {slim}
!define slim.flags {-s 2}
|fitnesse.fixtures.Sleep|20000|
-! |
|test results for page|TestPage|should contain|The instruction timed out after 2 seconds|
|test results for page in debug mode|TestPage|should contain|The instruction timed out after 2 seconds|
!define slim.flags {-s 1}
#Will pass
|fitnesse.fixtures.Sleep|20|

#Will fail
|fitnesse.fixtures.Sleep|90000|
-!|
|test results for page in debug mode|TestPage|should contain|The instruction timed out after 1 seconds |
|test results for page in debug mode|TestPage|should contain|!-span class="pass">fitnesse.fixtures.Sleep</span-!|
14 changes: 14 additions & 0 deletions test/fitnesse/slim/fixtureInteraction/InteractionBenchmark.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package fitnesse.slim.fixtureInteraction;

import fitnesse.slim.MethodExecutionResult;

import org.junit.Ignore;
import org.junit.Test;

import java.util.Collections;
Expand All @@ -11,14 +13,20 @@
* Micro benchmark to see how interactions compare.
* A benchmark like this proves almost nothing about real usage, but gives an indication
* about relative speed.
*
* This is one of the longest running tests and meaningless to run as part of every build
* as the performance is not compared against any reference
* Therefore it is skipped by default
*/
public class InteractionBenchmark {

@Ignore
@Test
public void timeSimple1_10() throws Throwable {
callOften(new SimpleInteraction(), 1, 10);
}

@Ignore
@Test
public void timeCached1_10() throws Throwable {
callOften(new CachedInteraction(), 1, 10);
Expand All @@ -34,31 +42,37 @@ public void timeCached1() throws Throwable {
callOften(new CachedInteraction(), 1, 100);
}

@Ignore
@Test
public void timeSimple100() throws Throwable {
callOften(new SimpleInteraction(), 100, 100);
}

@Ignore
@Test
public void timeCached100() throws Throwable {
callOften(new CachedInteraction(), 100, 100);
}

@Ignore
@Test
public void timeSimple1000() throws Throwable {
callOften(new SimpleInteraction(), 1_000, 100);
}

@Ignore
@Test
public void timeCached1000() throws Throwable {
callOften(new CachedInteraction(), 1_000, 100);
}

@Ignore
@Test
public void timeSimple10000() throws Throwable {
callOften(new SimpleInteraction(), 10_000, 100);
}

@Ignore
@Test
public void timeCached10000() throws Throwable {
callOften(new CachedInteraction(), 10_000, 100);
Expand Down

0 comments on commit 19ac942

Please sign in to comment.