You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using @segment/analytics-node to track analytics from my Lambda functions (runtime Node 18.x).
I recently noticed that by mistake some tests ran using Node 16 so I decided to fix that but when I upgraded to Node 18 (only changed the runtime for the tests), the tests that were meant to make sure analytics are sent started failing.
From my investigation it looks like the request itself was not sent, but event after I manually flushed (await client.flush()) the events the tests kept failing.
We create a new client with each tracked event (tried to use a single client but that didn't help).
It's worth mentioning that I tried to sent flushInterval to 0 and it didn't help and I also tried waiting for 2.5 seconds after flushing and that did not help either.
Our tests fail on the line that checks that a request was sent to https://api.segment.io/v1/batch.
Would appreciate any help with that.
Thanks.
The text was updated successfully, but these errors were encountered:
@dormesica If you look at at .github/ci.yaml, we have integration tests that run in node 18. Did you test manually with the Segment debugger?
Node 18 introduced a new fetch implementation. It could be that the bug is with the interception library: i.e. undici vs fetch: nock/nock#2183?
Our library, by default, uses the global fetch. Our tests actually monkey patch the global fetch with node-fetch to get around the nock interception issue.
Hi
I'm using
@segment/analytics-node
to track analytics from my Lambda functions (runtime Node 18.x).I recently noticed that by mistake some tests ran using Node 16 so I decided to fix that but when I upgraded to Node 18 (only changed the runtime for the tests), the tests that were meant to make sure analytics are sent started failing.
From my investigation it looks like the request itself was not sent, but event after I manually flushed (
await client.flush()
) the events the tests kept failing.We use the following client configuration:
We create a new client with each tracked event (tried to use a single client but that didn't help).
It's worth mentioning that I tried to sent
flushInterval
to 0 and it didn't help and I also tried waiting for 2.5 seconds after flushing and that did not help either.Our tests fail on the line that checks that a request was sent to
https://api.segment.io/v1/batch
.Would appreciate any help with that.
Thanks.
The text was updated successfully, but these errors were encountered: