Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure DelayType function gets consistent values of n #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

haaawk
Copy link

@haaawk haaawk commented Jan 21, 2025

Without this change DelayType function gets n either from 0,1,2,... or from 1,2,3,... depending on the value of Attempts config value.

This change unifies the behaviour and makes n always take values from 1,2,3,...

Fixes #124

Without this change DelayType function gets n either from
0,1,2,... or from 1,2,3,... depending on the value of Attempts
config value.

This change unifies the behaviour and makes n always take values from
1,2,3,...

Fixes avast#124

Signed-off-by: Piotr Jastrzebski <[email protected]>
@haaawk
Copy link
Author

haaawk commented Jan 21, 2025

It seems that there's some timing issue with one of the tests:

--- FAIL: TestMaxDelay (0.25s)
    retry_test.go:281: 
        	Error Trace:	D:/a/retry-go/retry-go/retry_test.go:281
        	Error:      	"251.57ms" is not less than "250ms"
        	Test:       	TestMaxDelay
        	Messages:   	5 times with maximum delay retry is longer than [25](https://github.com/avast/retry-go/actions/runs/12891476984/job/35943505687?pr=125#step:6:26)0ms

@haaawk
Copy link
Author

haaawk commented Jan 21, 2025

It seems that there's some timing issue with one of the tests:

--- FAIL: TestMaxDelay (0.25s)
    retry_test.go:281: 
        	Error Trace:	D:/a/retry-go/retry-go/retry_test.go:281
        	Error:      	"251.57ms" is not less than "250ms"
        	Test:       	TestMaxDelay
        	Messages:   	5 times with maximum delay retry is longer than [25](https://github.com/avast/retry-go/actions/runs/12891476984/job/35943505687?pr=125#step:6:26)0ms

It seems that this test is already disabled for mac:

         if os.Getenv("OS") == "macos-latest" {
		t.Skip("Skipping testing in MacOS GitHub actions - too slow, duration is wrong")
	}

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.

retry.DelayType gets inconsistent values
1 participant