Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/troubleshoot/cli/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,14 +513,14 @@ func TestReadLinesFromReader(t *testing.T) {
content: "line1\nline2\nline3\n",
maxBytes: 1000,
wantLen: 3,
wantLast: "line3",
wantLast: "line3\n",
},
{
name: "content exceeds limit",
content: "line1\nline2\nline3\nline4\nline5\n",
maxBytes: 15, // Only allows first 2 lines plus truncation marker
wantLen: 3,
wantLast: "... (content truncated due to size)",
wantLast: "... (content truncated due to size)\n",
},
{
name: "empty content",
Expand Down
5 changes: 3 additions & 2 deletions cmd/troubleshoot/cli/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ func Test_loadSupportBundleSpecsFromURIs_TimeoutError(t *testing.T) {
})
require.NoError(t, err)

// Set the timeout on the http client to 10ms
// Set the timeout on the http client to 500ms
// The server sleeps for 2 seconds, so this should still timeout
// supportbundle.LoadSupportBundleSpec does not yet use the context
before := httputil.GetHttpClient().Timeout
httputil.GetHttpClient().Timeout = 10 * time.Millisecond
httputil.GetHttpClient().Timeout = 500 * time.Millisecond
defer func() {
// Reinstate the original timeout. Its a global var so we need to reset it
httputil.GetHttpClient().Timeout = before
Expand Down
Loading