Skip to content

Commit d532b84

Browse files
committed
Debug issue
1 parent af42595 commit d532b84

File tree

1 file changed

+29
-0
lines changed
  • headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse

1 file changed

+29
-0
lines changed

headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919

2020
import java.io.IOException;
2121
import java.io.InputStream;
22+
import java.time.Duration;
2223
import java.util.Arrays;
2324
import java.util.List;
25+
import java.util.Map;
26+
import java.util.concurrent.CompletableFuture;
2427
import java.util.function.Predicate;
2528
import java.util.stream.Collectors;
2629

@@ -51,6 +54,9 @@
5154
import com.google.common.collect.ImmutableList;
5255
import com.google.common.collect.ImmutableSet;
5356

57+
import reactor.core.Disposable;
58+
import reactor.core.publisher.Mono;
59+
5460
@RunWith(SpringRunner.class)
5561
@ConcourseLanguageServerTest
5662
public class ConcourseEditorTest {
@@ -4803,8 +4809,29 @@ public void taskWithYamlParams() throws Exception {
48034809
" group-two::Groups\n"
48044810
);
48054811
}
4812+
4813+
private static StringBuffer getStackDumps() {
4814+
StringBuffer sb = new StringBuffer();
4815+
Map<Thread, StackTraceElement[]> traces = Thread.getAllStackTraces();
4816+
for (Map.Entry<Thread, StackTraceElement[]> entry : traces.entrySet()) {
4817+
sb.append(entry.getKey().toString());
4818+
sb.append("\n");
4819+
for (StackTraceElement element : entry.getValue()) {
4820+
sb.append(" ");
4821+
sb.append(element.toString());
4822+
sb.append("\n");
4823+
}
4824+
sb.append("\n");
4825+
}
4826+
return sb;
4827+
}
4828+
48064829

48074830
@Test public void reconcilerRaceCondition() throws Exception {
4831+
Disposable future = Mono.fromRunnable(() -> {
4832+
System.out.println(getStackDumps());
4833+
}).delaySubscription(Duration.ofSeconds(60)).subscribe();
4834+
48084835
Editor editor = harness.newEditor("garbage");
48094836
System.out.println("Editor created");
48104837
SynchronizationPoint reconcilerThreadStart = harness.reconcilerThreadStart();
@@ -4829,6 +4856,8 @@ public void taskWithYamlParams() throws Exception {
48294856
"garbage"
48304857
);
48314858
editor.assertProblems("garbage|Expecting a 'Map'");
4859+
4860+
future.dispose();
48324861
}
48334862

48344863
@Test public void noAutoInsertRequiredSourcePropertiesIfPresent() throws Exception {

0 commit comments

Comments
 (0)