Skip to content

Commit e390312

Browse files
craig[bot]alyshanjahani-crldhartunian
committed
151494: roachtest: Skip rangelog endpoint in db-console/endpoints roachtest r=alyshanjahani-crl a=alyshanjahani-crl This commit skips the rangelog endpoint on the admin server. This failure mode is described in #149866 (comment) Part of: #149866 Release note: None 151506: sql: remove unnecessary jaeger trace test r=alyshanjahani-crl a=dhartunian This test case was merged into the test above. Epic: None Release note: None 151542: netutil: Add ReadHeaderTimeout to http servers r=alyshanjahani-crl a=alyshanjahani-crl The DB Console only expects simple GETs/POSTs/PUTs. It is a best practice to then include a read header timeout. Epic: none Release note: None Co-authored-by: Alyshan Jahani <[email protected]> Co-authored-by: David Hartunian <[email protected]>
4 parents 114eca7 + 41f4051 + bde28ff + 50bea89 commit e390312

File tree

3 files changed

+4
-43
lines changed

3 files changed

+4
-43
lines changed

pkg/cmd/roachtest/tests/db-console/admin_endpoints.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
},
8383
{
8484
"url": "/_admin/v1/rangelog/{range_id}",
85-
"method": "GET"
85+
"method": "GET",
86+
"skip": "https://github.com/cockroachdb/cockroach/issues/149866#issuecomment-3161313828"
8687
},
8788
{
8889
"url": "/_admin/v1/data_distribution",

pkg/sql/trace_test.go

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -724,44 +724,3 @@ func TestTraceTxnSampleRateAndThreshold(t *testing.T) {
724724
})
725725
}
726726
}
727-
728-
func TestTraceTxnJaegerOutput(t *testing.T) {
729-
defer leaktest.AfterTest(t)()
730-
defer log.Scope(t).Close(t)
731-
732-
ctx := context.Background()
733-
settings := cluster.MakeTestingClusterSettings()
734-
735-
s, db, _ := serverutils.StartServer(t, base.TestServerArgs{
736-
Settings: settings,
737-
})
738-
defer s.Stopper().Stop(ctx)
739-
740-
appLogsSpy := logtestutils.NewLogSpy(
741-
t,
742-
// This string match is constructed from the log.SqlExec.Infof format
743-
// string found in conn_executor_exec.go:logTraceAboveThreshold
744-
logtestutils.MatchesF("exceeding threshold of"),
745-
)
746-
cleanup := log.InterceptWith(ctx, appLogsSpy)
747-
defer cleanup()
748-
749-
sql.TraceTxnOutputJaegerJSON.Override(ctx, &settings.SV, true)
750-
sql.TraceTxnThreshold.Override(ctx, &settings.SV, time.Nanosecond)
751-
sql.TraceTxnSampleRate.Override(ctx, &settings.SV, 1)
752-
log.FlushAllSync()
753-
appLogsSpy.Reset()
754-
r := sqlutils.MakeSQLRunner(db)
755-
756-
testutils.SucceedsSoon(t, func() error {
757-
r.Exec(t, "SELECT pg_sleep(0.01)")
758-
log.FlushAllSync()
759-
if !appLogsSpy.Has(logtestutils.MatchesF(regexp.QuoteMeta("ExecStmt: SELECT pg_sleep(0.01)"))) {
760-
return errors.New("no sql txn log found (tracing did not happen)")
761-
}
762-
if !appLogsSpy.Has(logtestutils.MatchesF(regexp.QuoteMeta("{\"refType\":\"CHILD_OF\",\"traceID\":\""))) {
763-
return errors.New("no Jaeger JSON found")
764-
}
765-
return nil
766-
})
767-
}

pkg/util/netutil/net.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ func MakeHTTPServer(
8686
delete(activeConns, conn)
8787
}
8888
},
89-
ErrorLog: httpLogger,
89+
ErrorLog: httpLogger,
90+
ReadHeaderTimeout: 5 * time.Second,
9091
},
9192
}
9293

0 commit comments

Comments
 (0)