Skip to content

Commit 6e3a713

Browse files
committed
Tweak timeout in PathologicalTest
Test sometimes fails on some build machines.
1 parent 3f1c724 commit 6e3a713

1 file changed

Lines changed: 18 additions & 19 deletions

File tree

commonmark/src/test/java/org/commonmark/test/PathologicalTest.java

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
1717
public class PathologicalTest extends CoreRenderingTestCase {
1818

19-
private static final int X = 10_000;
19+
private int x = 10_000;
2020

2121
@Rule
22-
public Timeout timeout = new Timeout(2, TimeUnit.SECONDS);
22+
public Timeout timeout = new Timeout(3, TimeUnit.SECONDS);
2323

2424
@Rule
2525
public Stopwatch stopwatch = new Stopwatch() {
@@ -32,7 +32,7 @@ protected void finished(long nanos, Description description) {
3232
@Test
3333
public void nestedStrongEmphasis() {
3434
// this is limited by the stack size because visitor is recursive
35-
int x = 1000;
35+
x = 1000;
3636
assertRendering(
3737
repeat("*a **a ", x) + "b" + repeat(" a** a*", x),
3838
"<p>" + repeat("<em>a <strong>a ", x) + "b" +
@@ -42,56 +42,56 @@ public void nestedStrongEmphasis() {
4242
@Test
4343
public void emphasisClosersWithNoOpeners() {
4444
assertRendering(
45-
repeat("a_ ", X),
46-
"<p>" + repeat("a_ ", X - 1) + "a_</p>\n");
45+
repeat("a_ ", x),
46+
"<p>" + repeat("a_ ", x - 1) + "a_</p>\n");
4747
}
4848

4949
@Test
5050
public void emphasisOpenersWithNoClosers() {
5151
assertRendering(
52-
repeat("_a ", X),
53-
"<p>" + repeat("_a ", X - 1) + "_a</p>\n");
52+
repeat("_a ", x),
53+
"<p>" + repeat("_a ", x - 1) + "_a</p>\n");
5454
}
5555

5656
@Test
5757
public void linkClosersWithNoOpeners() {
5858
assertRendering(
59-
repeat("a] ", X),
60-
"<p>" + repeat("a] ", X - 1) + "a]</p>\n");
59+
repeat("a] ", x),
60+
"<p>" + repeat("a] ", x - 1) + "a]</p>\n");
6161
}
6262

6363
@Test
6464
public void linkOpenersWithNoClosers() {
6565
assertRendering(
66-
repeat("[a ", X),
67-
"<p>" + repeat("[a ", X - 1) + "[a</p>\n");
66+
repeat("[a ", x),
67+
"<p>" + repeat("[a ", x - 1) + "[a</p>\n");
6868
}
6969

7070
@Test
7171
public void linkOpenersAndEmphasisClosers() {
7272
assertRendering(
73-
repeat("[ a_ ", X),
74-
"<p>" + repeat("[ a_ ", X - 1) + "[ a_</p>\n");
73+
repeat("[ a_ ", x),
74+
"<p>" + repeat("[ a_ ", x - 1) + "[ a_</p>\n");
7575
}
7676

7777
@Test
7878
public void mismatchedOpenersAndClosers() {
7979
assertRendering(
80-
repeat("*a_ ", X),
81-
"<p>" + repeat("*a_ ", X - 1) + "*a_</p>\n");
80+
repeat("*a_ ", x),
81+
"<p>" + repeat("*a_ ", x - 1) + "*a_</p>\n");
8282
}
8383

8484
@Test
8585
public void nestedBrackets() {
8686
assertRendering(
87-
repeat("[", X) + "a" + repeat("]", X),
88-
"<p>" + repeat("[", X) + "a" + repeat("]", X) + "</p>\n");
87+
repeat("[", x) + "a" + repeat("]", x),
88+
"<p>" + repeat("[", x) + "a" + repeat("]", x) + "</p>\n");
8989
}
9090

9191
@Test
9292
public void nestedBlockQuotes() {
9393
// this is limited by the stack size because visitor is recursive
94-
int x = 1000;
94+
x = 1000;
9595
assertRendering(
9696
repeat("> ", x) + "a\n",
9797
repeat("<blockquote>\n", x) + "<p>a</p>\n" +
@@ -105,5 +105,4 @@ private static String repeat(String s, int count) {
105105
}
106106
return sb.toString();
107107
}
108-
109108
}

0 commit comments

Comments
 (0)