Repository navigation
Conversation
…cancel and build failure in it dd-trace and Sentry rewrite and wrap the driver by shape, and npm run test:tracing, which packs the fork and compares the spans against Postgres.js 3.4.9, was only ever run by hand. It now runs as a job on every pull request, and a release waits for it like it waits for the test jobs. The comparison had no COPY scenario, but dd-trace ends a COPY span on the second resolve of the query, so a change that settles a query once would leave every COPY span open and nothing would notice. The harness gains COPY in and out, a query cancelled before it is sent and a query that fails to build, the paths the request lifecycle restructure (#73) touches.
The restructure of the pool and query side must not change behaviour, so these tests assert what main does today on real PostgreSQL, including paths that look wrong. They pass on main and are the reference the refactor commits are held to. The query's resolve and reject are counted with a spy. The counts pin current behaviour: COPY in and out resolve twice (the stream, then the result, which dd-trace relies on), sql`begin` on a pool resolves after it rejected with UNSAFE_TRANSACTION, and a query cancelled before it is awaited rejects once at max: 2 and three times at max: 1, where the refused statement is written and the server's reply to it also trips BindComplete on the unbuilt statement. The restructure settles each query once except COPY, so the later commit changes those entries in one table at the top of the group. A query cancelled before it is awaited is still routed when it is awaited. It is never built and the pool keeps working. An idle connection is filed busy afterwards, while a connection that was still closed opens idle. This is pinned for max: 1 and max: 2, warm and cold, so a later fix shows up as a deliberate change. Also covered: a reservation queued behind plain queries on a connection that is still opening gets it after them, and close() during the first query's connection start runs that query and lets the next one reopen.
Author
|
Check finished: main matches. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Temporary check of three tests against main. Close without merging.