You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @nickwales ,
I added a new case the the sample code that shows that max retries is honored for posting when there is no server on the other end. Let me know if things are still unclear. I'll close out this issue in a few days if I don't hear back. Cheers!
log.Println("> pester.Post with retries to non-existant url")
{
client := pester.New()
client.MaxRetries = 3
client.KeepLog = true
_, err := client.Post("http://localhost:9001", "application/json", strings.NewReader(`{"json":true}`))
if err == nil {
log.Printf("expected to error after max retries of 3")
}
if len(client.ErrLog) != 3 {
log.Fatalf("expected 3 error logs, got %d: %v", len(client.ErrLog), client.ErrLog)
}
log.Printf("POST: %v\n\n", err)
}
The sample POST test exits immediately when there is no server on the other end. (e.g. changing 9000 to 9001)
Any suggestions on how to handle retrying this?
The text was updated successfully, but these errors were encountered: