From ee26069c25552486bcf129947fd7df49f5e0e9e0 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Thu, 13 Jun 2024 15:33:39 +0200 Subject: [PATCH] Print backtrace when RPC fails --- cmd/soroban-rpc/internal/test/integration.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/soroban-rpc/internal/test/integration.go b/cmd/soroban-rpc/internal/test/integration.go index d63d1b3c..0409dd52 100644 --- a/cmd/soroban-rpc/internal/test/integration.go +++ b/cmd/soroban-rpc/internal/test/integration.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + "log" "net" "net/http" "net/http/httptest" @@ -14,6 +15,7 @@ import ( "os/signal" "path" "path/filepath" + "runtime" "strconv" "strings" "sync" @@ -253,6 +255,9 @@ func (i *Test) waitForRPC() { time.Sleep(time.Second) } if !success { + buf := make([]byte, 1<<16) + stackSize := runtime.Stack(buf, true) + log.Printf("%s\n", string(buf[0:stackSize])) i.t.Fatal("RPC failed to get healthy in 30 seconds") } }