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

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

haaawk
Copy link
Contributor

@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

@haaawk
Copy link
Contributor 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
Contributor 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")
	}

@JaSei
Copy link
Collaborator

JaSei commented Feb 21, 2025

Hi, I sincerely apologize for the delayed response. I've fixed the tests in #99. Please rebase your PR against the main branch so we can proceed with the review. Thank you for your patience and contribution!

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
Contributor Author

haaawk commented Feb 22, 2025

Hi, I sincerely apologize for the delayed response. I've fixed the tests in #99. Please rebase your PR against the main branch so we can proceed with the review. Thank you for your patience and contribution!

Thanks @JaSei! I pushed the rebased version.

Copy link

codecov bot commented Feb 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.86%. Comparing base (79a35c4) to head (8d7cef7).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #125   +/-   ##
=======================================
  Coverage   90.86%   90.86%           
=======================================
  Files           2        2           
  Lines         230      230           
=======================================
  Hits          209      209           
  Misses         17       17           
  Partials        4        4           
Flag Coverage Δ
unittest 90.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JaSei
Copy link
Collaborator

JaSei commented Feb 24, 2025

Thank you, for your PR

@JaSei JaSei merged commit d20c351 into avast:master Feb 24, 2025
19 checks passed
@haaawk
Copy link
Contributor Author

haaawk commented Feb 24, 2025

Thanks @JaSei !

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
2 participants