Skip to content

pkg/currency: Add error tags on currency exchange errors#76

Merged
Sypheos merged 6 commits intomasterfrom
sp/currency-tagged-error
Jul 9, 2025
Merged

pkg/currency: Add error tags on currency exchange errors#76
Sypheos merged 6 commits intomasterfrom
sp/currency-tagged-error

Conversation

@Sypheos
Copy link
Member

@Sypheos Sypheos commented Jul 2, 2025

What does this PR do?

Add error tags and wrapping for currency exchange to make debugging easier

What are the observable changes?

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation
  • Properly labeled

Additional Notes

@Sypheos Sypheos requested a review from a team as a code owner July 2, 2025 12:59
@Sypheos Sypheos self-assigned this Jul 2, 2025
@Sypheos Sypheos requested review from FlorianRichardUPF and xgoffin and removed request for a team July 2, 2025 12:59
Co-authored-by: Xavier Goffin <86716549+xgoffin@users.noreply.github.com>
Co-authored-by: PL Pery <kar@karitham.dev>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no private 🙈

${{ runner.os }}-go-
- name: Run tests
run: go test -v ./...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when i said, no private i meant you can use the public action: https://github.com/upfluence/actions/blob/master/.github/workflows/lib-go-test.yml

@AlexisMontagne
Copy link
Member

Can you attach the following diff to fix the CI?

diff --git a/syncutil/singleflight_test.go b/syncutil/singleflight_test.go
index 14a11ec..514ffd3 100644
--- a/syncutil/singleflight_test.go
+++ b/syncutil/singleflight_test.go
@@ -114,6 +114,7 @@ func TestSingleflightStopOnClose(t *testing.T) {
 	var (
 		sf  Singleflight
 		ctr int32
+		wg  sync.WaitGroup
 
 		ctx   = context.Background()
 		donec = make(chan struct{})
@@ -130,17 +131,23 @@ func TestSingleflightStopOnClose(t *testing.T) {
 		return nil
 	}
 
+	wg.Add(1)
+
 	go func() {
 		ok, err := sf.Do(ctx, fn)
 
 		assert.True(t, ok)
 		assert.Equal(t, context.Canceled, err)
+
+		wg.Done()
 	}()
 
 	time.Sleep(10 * time.Millisecond)
 
+	sf.Close()
 	close(donec)
-	assert.Equal(t, int32(0), atomic.LoadInt32(&ctr))
 
-	sf.Close()
+	wg.Wait()
+
+	assert.Equal(t, int32(0), atomic.LoadInt32(&ctr))
 }

@Sypheos Sypheos merged commit 48f9977 into master Jul 9, 2025
4 checks passed
@Sypheos Sypheos deleted the sp/currency-tagged-error branch July 9, 2025 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments