Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: teamkeel/keel
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 691402261ce427057ee36785583beac70aba4f54
Choose a base ref
..
head repository: teamkeel/keel
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 718502a48a157ebb33e77394923611748af168d7
Choose a head ref
Showing with 5 additions and 2 deletions.
  1. +1 −1 packages/functions-runtime/package.json
  2. +4 −1 packages/functions-runtime/src/tracing.test.js
2 changes: 1 addition & 1 deletion packages/functions-runtime/package.json
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
"description": "Internal package used by @teamkeel/sdk",
"main": "src/index.js",
"scripts": {
"test": "DEBUG=true vitest run --reporter verbose --threads false",
"test": "vitest run --reporter verbose --threads false",
"format": "npx prettier --write src/**/*.js"
},
"keywords": [],
5 changes: 4 additions & 1 deletion packages/functions-runtime/src/tracing.test.js
Original file line number Diff line number Diff line change
@@ -33,7 +33,10 @@ test("withSpan span time", async () => {

expect(spanEvents.map((e) => e.event)).toEqual(["onStart", "onEnd"]);
const spanDuration = spanEvents.pop().span._duration.pop();
const waitTimeNanos = waitTimeMillis * 1000 * 1000;

// The '- 1' here is because sometimes the test fails due to the span duration
// being something like 99.87ms. As long as it's at least 99ms we're happy
const waitTimeNanos = (waitTimeMillis - 1) * 1000 * 1000;
expect(spanDuration).toBeGreaterThan(waitTimeNanos);
});