Skip to content

Commit

Permalink
[chore][exporter/signalfx] Attempt to resolve failing test (open-tele…
Browse files Browse the repository at this point in the history
…metry#27608)

**Description:** 
The APM correlation test is failing with too many retry updates. The
solution is to increase the `CleanupInterval` to allow the test time to
make multiple correlation calls within the same dedup cleanup interval.
I posted the full description in [this issue
comment.](open-telemetry#27059 (comment))

Before this fix this test would fail _almost_ every time since it was
introduced into this repo, I haven't seen any failure since this update
(9 successful runs).

**Link to tracking Issue:** Resolves open-telemetry#27059
  • Loading branch information
crobert-1 authored and RoryCrispin committed Nov 24, 2023
1 parent c1e02fb commit 6116518
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (cc *Client) putRequestOnChan(r *request) error {

func (cc *Client) putRequestOnRetryChan(r *request) error {
// handle request counter
if requestcounter.GetRequestCount(r.ctx) == cc.maxAttempts {
if requestcounter.GetRequestCount(r.ctx) >= cc.maxAttempts {
return errMaxAttempts
}
requestcounter.IncrementRequestCount(r.ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ func setup(t *testing.T) (CorrelationClient, chan *request, *atomic.Value, *atom
MaxBuffered: 10,
MaxRetries: 4,
LogUpdates: true,
RetryDelay: 0,
CleanupInterval: 0,
RetryDelay: 0 * time.Second,
CleanupInterval: 1 * time.Minute,
},
AccessToken: "",
URL: serverURL,
Expand Down Expand Up @@ -180,7 +180,6 @@ func setup(t *testing.T) (CorrelationClient, chan *request, *atomic.Value, *atom
}

func TestCorrelationClient(t *testing.T) {
t.Skip("See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27059")
client, serverCh, forcedRespCode, forcedRespPayload, cancel := setup(t)
defer close(serverCh)
defer cancel()
Expand Down Expand Up @@ -248,6 +247,7 @@ func TestCorrelationClient(t *testing.T) {

cors := waitForCors(serverCh, 1, 4)
require.Len(t, cors, 0)
require.Equal(t, uint32(5), client.(*Client).maxAttempts)
require.Equal(t, int64(5), atomic.LoadInt64(&client.(*Client).TotalRetriedUpdates))

forcedRespCode.Store(200)
Expand Down

0 comments on commit 6116518

Please sign in to comment.