Skip to content

Add net/http timeout, io.Error, and random success/failure support fo…#121

Draft
ljluestc wants to merge 1 commit intoh2non:masterfrom
ljluestc:feature/issue-44-timeout-ioerror-random
Draft

Add net/http timeout, io.Error, and random success/failure support fo…#121
ljluestc wants to merge 1 commit intoh2non:masterfrom
ljluestc:feature/issue-44-timeout-ioerror-random

Conversation

@ljluestc
Copy link
Copy Markdown

This PR addresses issue #44 by adding:

  • Timeout simulation with Response.Timeout to mimic net/http timeouts.
  • I/O error simulation with Response.IOError for errors like io.EOF.
  • Random success/failure with Response.Randomize (30% failure chance).

Tests in response_test.go verify the features. All files formatted with go fmt.

Note: Issue #44 was filed under xjdrew/gork but applied to h2non/gock based on context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant