Skip to content

Keep retrying a bit of Go test code that you know _should_ pass, eventually, idiomatically.

License

Notifications You must be signed in to change notification settings

rentziass/eventually

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eventually

// Must will keep trying until it succeeds or the test times out or reaches
// max attempts. If it fails, it will call t.Fatalf.
eventually.Must(t, func(t testing.TB) {
	t.Fatal("but keep trying")
}, eventually.WithMaxAttempts(10))

// Should will keep trying until it succeeds or the test times out or reaches
// max attempts. If it fails, it will call t.Errorf.
eventually.Should(t, func(t testing.TB) {
	t.Fatal("but keep trying")
}, eventually.WithTimeout(10*time.Second), eventually.WithInterval(1*time.Second))

TODO

  • Add documentation

About

Keep retrying a bit of Go test code that you know _should_ pass, eventually, idiomatically.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages