Skip to content

Commit 0574b9d

Browse files
committed
fixes
1 parent af0733f commit 0574b9d

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

packages/core/test/lib/utils/promisebuffer.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,12 @@ describe('PromiseBuffer', () => {
149149
expect(p5).toHaveBeenCalled();
150150

151151
expect(buffer.$.length).toEqual(5);
152-
const result = await buffer.drain(8);
152+
const result = await buffer.drain(6);
153153
expect(result).toEqual(false);
154-
// p5 is still in the buffer
155-
expect(buffer.$.length).toEqual(1);
154+
// p5 & p4 are still in the buffer
155+
// Leaving some wiggle room, possibly one or two items are still in the buffer
156+
// to avoid flakiness
157+
expect(buffer.$.length).toBeGreaterThanOrEqual(1);
156158

157159
// Now drain final item
158160
const result2 = await buffer.drain();

packages/node-core/src/integrations/http/httpServerIntegration.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ import { MAX_BODY_BYTE_LENGTH } from './constants';
2222

2323
type ServerEmit = typeof Server.prototype.emit;
2424

25+
// Inlining this type to not depend on newer TS types
26+
interface WeakRefImpl<T> {
27+
deref(): T | undefined;
28+
}
29+
2530
type StartSpanCallback = (next: () => boolean) => boolean;
2631
type RequestWithOptionalStartSpanCallback = IncomingMessage & {
27-
_startSpanCallback?: WeakRef<StartSpanCallback>;
32+
_startSpanCallback?: WeakRefImpl<StartSpanCallback>;
2833
};
2934

3035
const HTTP_SERVER_INSTRUMENTED_KEY = createContextKey('sentry_http_server_instrumented');

0 commit comments

Comments
 (0)