Skip to content

test(#10235): admission-gate conformance test for every surface - #10294

Merged
robfrank merged 4 commits into
mainfrom
feat/10235-admission-gate-conformance-test
Oct 18, 2026
Merged

robfrank merged 4 commits into
mainfrom
feat/10235-admission-gate-conformance-test

Conversation

@robfrank

@robfrank robfrank commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #10235

Summary

Adds the regression guard #10140 asked for. If a request is admitted on one thread and its statement runs on another, that statement's releaseCurrentSlot() must still find the slot. This PR changes tests only, no production code.

  • AdmissionSlotConformance (server test-jar) is one shared check. It enables the gate with one slot and registers a BeforeRecordCreateListener on the type the request writes to, then sends the request through the surface. The listener runs on the thread that runs the statement, so it works the same for every protocol: SQL, Cypher, Gremlin, Redis HSET, a MongoDB insert or a bulk load. That is why no per-module hook (test SQL function, test query engine) is needed. The listener calls releaseCurrentSlot() and blocks. The check then asserts:
    • the statement ran admitted (getRunning()==1 when the hook ran)
    • releaseCurrentSlot() returned true on that thread
    • getRunning()==0 while the statement still waits
    • the request then completes and leaves no slot taken
  • One test per module drives it through each surface (table below).
  • AdmissionSurfaceCensusTest (server) scans every module's src/main/java for classes that use QueryAdmissionGate and call .admit(. It fails if one of them is not mapped to a conformance test that calls the check. So a surface added later fails CI until it has its own test. This is the "would then fail that test instead of silently losing the release" part of the issue.

Coverage

Invariant: for every surface that admits through the gate, the slot is reachable from the thread that runs the request's statement.

Census command: git grep -nE "\.admit\(" -- '*/src/main/java/*.java', keeping files that use QueryAdmissionGate. It finds 9 classes:

Admitting class Entry points driven Test Status
DatabaseAbstractHandler POST /command, POST /command inside an HTTP session AdmissionSlotConformanceHttpTest covered
PostBatchHandler POST /batch AdmissionSlotConformanceHttpTest covered
PostgresNetworkExecutor simple and extended protocol, auto-commit and in a transaction AdmissionSlotConformancePostgresIT covered (the Describe/COPY admits are read-only and run on the same connection thread)
BoltNetworkExecutor auto-commit, explicit transaction AdmissionSlotConformanceBoltIT covered
RedisNetworkExecutor HSET AdmissionSlotConformanceRedisTest covered
MongoDBBackend insertOne AdmissionSlotConformanceMongoTest covered
MCPDispatcher execute_command tool AdmissionSlotConformanceMcpIT covered
ArcadeGraphManager bytecode traversal, script AdmissionSlotConformanceGremlinTest (runs in gremlin-it) covered
GrpcAdmissionInterceptor executeCommand with and without a client transaction AdmissionSlotConformanceGrpcIT covered

Commits are not a row. The only production releaseCurrentSlot() callers are statement-level: RaftReplicatedDatabase.forwardCommandToLeaderViaRaft (a follower forwarding a command) and TransactionContext.explicitLock (LOCK). A commit never releases a slot, so a commit-time hook would test nothing that production does.

Known gaps: None.

Proof the check can fail

I temporarily replaced admission.adopt() in ArcadeDbGrpcService.submitToActiveTransaction with an adoption taken on the transaction thread, which is the #10140 bug. AdmissionSlotConformanceGrpcIT.aCommandInsideAClientTransactionGivesItsSlotBackFromTheTransactionThread then fails:

[gRPC executeCommand in a transaction: releaseCurrentSlot() finds the slot on the thread that runs the statement (arcadedb-tx-tx_...)]
Expecting value to be true but was false

The no-transaction gRPC row stayed green. I reverted the change afterwards.

Test plan

  • mvn -o test -pl server -Dtest='AdmissionSurfaceCensusTest,AdmissionSlotConformanceHttpTest,HardcodedTestServerPortsTest,QueryAdmissionGateHttpIssue9518Test': 15/15
  • mvn -o verify -pl redisw,mongodbw,grpcw,mcp,postgresw,bolt -DskipITs=false with the conformance classes: all green
  • mvn -o verify -pl gremlin,gremlin-it -Dtest='AdmissionSlotConformanceGremlinTest,QueryAdmissionGateGremlinIssue9518Test': 2/2
  • Mutation check on the gRPC hand-off (above): red, then green after the revert

Adversarial pass

This session had no tool for starting the independent subagent that Phase 1.5 calls for, so I did the pass myself instead. Findings:

Review cycles

Cycle Head Changes Bot outcome
1 c946e0c88d initial claude: no blockers. Applied: Map.ofEntries, reactor root from basedir, gate restore in its own finally, shorter HTTP lines
2 07d62e9d06 review fixes claude: LGTM with minors. Applied: fail fast when the request ends before reaching the hook, awaitTermination on the client thread before the gate is reset, Gremlin traversal source in try-with-resources
3 99121eb967 review fixes claude: good to merge once the IT lane is confirmed. Applied: reset() an unchanged setting instead of writing it back, interrupt flag not restored on the server writer thread (a later FileChannel write would fail with ClosedByInterruptException), census limits stated in the Javadoc, comment on the first-record-only probe
4 754b3edd38 review fixes claude: looks good, no blockers. Max cycles reached, nothing pushed after this

Deferred items (cycle 4, all non-blocking)

  • "Census is a text match... consider stripping comments before matching." Skipped. The class Javadoc now states the census's limits. A false positive asks for a mapping, which is visible and fails safe. A false negative needs a gate reached through a helper class, which no surface does today.
  • "A @disabled test, or one calling it from a dead branch, still passes." Skipped. The limit is documented in the census Javadoc (cycle 3).
  • "Confirm parallel execution is off, or add @isolated / @ResourceLock." Confirmed. No module sets junit.jupiter.execution.parallel.*; only e2e has a junit-platform.properties, and it documents that classes run one after another. The helper also refuses to start until getRunning()==0.
  • "TIMEOUT_MS reused for awaitTermination... failure paths can stack to minutes." Skipped. The timeouts are hang detectors and stack only on a failure path that is already red.
  • "An Assumptions skip would be friendlier for partial source trees." Declined on purpose. A skip would turn a census that checks nothing into a green run, which is the failure this assertion exists to prevent (same choice as HardcodedTestServerPortsTest).
  • "ALL CAPS comments." These match the surrounding code (QueryAdmissionGate, the Admission gate for queries: FIFO queue with memory-aware admission for every remote protocol #9518 tests).
  • *"Confirm the IT classes are picked up by Failsafe." Confirmed. CI's integration-tests job runs ./mvnw verify -DskipTests -Pintegration -pl !e2e,!load-tests,!e2e-ha,!ha-raft (.github/workflows/mvn-test.yml:666). The root pom wires Failsafe's skipTests to ${skipITs}, which -Pintegration sets to false. The existing QueryAdmissionGate*Issue9518IT classes in the same modules run the same way. Locally all four ITs ran with -DskipITs=false. The Gremlin test runs through gremlin-it, like every other Gremlin test.

Final state

max-cycles-reached. All 4 cycles ran, and every cycle's review said nothing blocks the merge. The cycle-4 suggestions are listed above with how each was handled; none is a defect.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Expanded integration coverage across BOLT, Gremlin, gRPC, MCP, MongoDB, PostgreSQL, Redis, and HTTP.
    • Verified that concurrent request capacity is returned after commands complete, including transaction, session, batch, and query-mode scenarios.

…he thread that runs the statement

A conformance check shared through the server test-jar (AdmissionSlotConformance) and one test per
surface: HTTP command, HTTP session, bulk load, Postgres simple/extended in and out of a transaction,
Bolt auto-commit and explicit transaction, Redis HSET, MongoDB insert, MCP execute_command, Gremlin
traversal and script, gRPC with and without a client transaction. A census test fails when a new class
admits through the gate without a conformance test.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e3a44f0-e085-42c3-a0c2-24548880a2f9
📥 Commits

Reviewing files that changed from the base of the PR and between 1a8d72a and 754b3ed.

📒 Files selected for processing: 10
  • bolt/src/test/java/com/arcadedb/bolt/AdmissionSlotConformanceBoltIT.java
  • gremlin/src/test/java/com/arcadedb/server/gremlin/AdmissionSlotConformanceGremlinTest.java
  • grpcw/src/test/java/com/arcadedb/server/grpc/AdmissionSlotConformanceGrpcIT.java
  • mcp/src/test/java/com/arcadedb/mcp/AdmissionSlotConformanceMcpIT.java
  • mongodbw/src/test/java/com/arcadedb/mongo/AdmissionSlotConformanceMongoTest.java
  • postgresw/src/test/java/com/arcadedb/postgres/AdmissionSlotConformancePostgresIT.java
  • redisw/src/test/java/com/arcadedb/redis/AdmissionSlotConformanceRedisTest.java
  • server/src/test/java/com/arcadedb/server/AdmissionSlotConformance.java
  • server/src/test/java/com/arcadedb/server/AdmissionSurfaceCensusTest.java
  • server/src/test/java/com/arcadedb/server/http/handler/AdmissionSlotConformanceHttpTest.java

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

📝 Walkthrough

Adds a shared test utility that checks admission-slot release while a request waits at a first-record hook. Adds conformance tests for HTTP, gRPC, BOLT, Gremlin, PostgreSQL, MCP, MongoDB, and Redis surfaces.

Changes: Admission-slot conformance

Layer / File(s) Summary
Shared assertion and surface inventory
server/src/test/java/com/arcadedb/server/AdmissionSlotConformance.java, server/src/test/java/com/arcadedb/server/AdmissionSurfaceCensusTest.java
The shared assertion checks slot occupancy, release, request completion, and configuration cleanup. The census test compares discovered admission surfaces with the mapped conformance tests.
HTTP and gRPC conformance
server/src/test/java/com/arcadedb/server/http/handler/AdmissionSlotConformanceHttpTest.java, grpcw/src/test/java/com/arcadedb/server/grpc/AdmissionSlotConformanceGrpcIT.java
HTTP tests cover direct commands, session commands, and batch loads. gRPC tests cover command execution with and without a client transaction.
Query and traversal protocol conformance
bolt/src/test/java/com/arcadedb/bolt/AdmissionSlotConformanceBoltIT.java, gremlin/src/test/java/com/arcadedb/server/gremlin/AdmissionSlotConformanceGremlinTest.java, postgresw/src/test/java/com/arcadedb/postgres/AdmissionSlotConformancePostgresIT.java
Tests cover BOLT auto-commit and explicit transactions, Gremlin traversals and scripts, and PostgreSQL simple and extended query modes with and without auto-commit.
Command and document protocol conformance
mcp/src/test/java/com/arcadedb/mcp/AdmissionSlotConformanceMcpIT.java, mongodbw/src/test/java/com/arcadedb/mongo/AdmissionSlotConformanceMongoTest.java, redisw/src/test/java/com/arcadedb/redis/AdmissionSlotConformanceRedisTest.java
Tests check slot release during MCP command execution, MongoDB inserts, and Redis commands.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 754b3

The added conformance tests do not change production behavior, and no actionable merge-blocking risk was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 2.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 39 functions across 10 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Issue #10235 requires a shared conformance check for each admission surface. AdmissionSlotConformance enables one slot, registers a first-record listener, calls releaseCurrentSlot() on the stateme…
Out of Scope Changes check Passed The pull request adds only test utilities and conformance tests. The census test and protocol-specific setup support the regression requirement in issue #10235. No unrelated production behavior or unr…
Title check Passed The title clearly identifies the admission-gate conformance tests and their coverage across all surfaces.
Description check Passed The description is detailed and covers the change, motivation, related issue, test coverage, validation results, known gaps, and review notes. It uses different headings from the template, but it prov…
Full details: Linked Issues check

Explanation

Issue #10235 requires a shared conformance check for each admission surface. AdmissionSlotConformance enables one slot, registers a first-record listener, calls releaseCurrentSlot() on the statement thread, blocks the request, and asserts admission, release success, zero running slots during the wait, and clean completion. AdmissionSurfaceCensusTest maps all nine discovered admitting classes to conformance tests. The added tests cover HTTP and PostBatch, PostgreSQL, Bolt, Redis, MongoDB, MCP, Gremlin, and gRPC with and without a client transaction. The reported validation is green.

Full details: Out of Scope Changes check

Explanation

The pull request adds only test utilities and conformance tests. The census test and protocol-specific setup support the regression requirement in issue #10235. No unrelated production behavior or unrelated feature changes are shown.

Full details: Description check

Explanation

The description is detailed and covers the change, motivation, related issue, test coverage, validation results, known gaps, and review notes. It uses different headings from the template, but it provides the required information and is mostly complete.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

codacy-production Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Coverage ∅ diff coverage · -4.97% coverage variation

Metric Results
Coverage variation ✅ -4.97% coverage variation
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (1a8d72a) 241123 208852 86.62%
Head commit (754b3ed) 273824 (+32701) 223555 (+14703) 81.64% (-4.97%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#10294) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@mergify

mergify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@claude

claude Bot commented Oct 18, 2026

Copy link
Copy Markdown

Review: admission-gate conformance tests (#10235)

Tests only, and the design is sound. Hooking BeforeRecordCreateListener to run releaseCurrentSlot() on the statement's own thread works for every protocol without per-module hooks. The mutation check on the gRPC hand-off is good evidence that the check can fail. The census test is a useful tripwire.

Suggestions

  1. SURFACES uses Map.of(...) with 9 pairs (AdmissionSurfaceCensusTest). Map.of stops at 10 pairs. The next surface after one more will not compile, and the error will not say why. Use Map.ofEntries(Map.entry(...)) or a small list of records. It would also read better than 18 alternating strings.
  2. The census checks that the test mentions the call, not that it covers the surface. contains("AdmissionSlotConformance.assertGivesItsSlotBack(") passes for a commented-out call, or for a test that only drives one of several entry points. This is probably acceptable. The Javadoc and PR text say "has a test that calls the check", so I would not claim more than that.
  3. The census depends on the working directory (Path.of("..")). The isRegularFile guard fails loudly, which is good. It will still break if surefire is ever run from the reactor root, for example with a different basedir or from an IDE. Resolving from System.getProperty("basedir"), falling back to user.dir, would be more robust.
  4. Probe.onBeforeCreate swallows a timeout. proceed.await(...) returns false on timeout and the result is ignored, so the statement carries on. The test fails separately in that case, so this is harmless. The same applies to the interrupt branch.
  5. Global state. QUERY_MAX_CONCURRENT and QUERY_QUEUE_TIMEOUT are restored in finally. If the proceed.countDown() / unregisterListener calls ever throw, the restore is skipped. Nesting the restore in its own finally would be safer. It is minor.
  6. Style (CLAUDE.md):
    • Several lines in AdmissionSlotConformanceHttpTest, for example the post(...).POST(...).build() chains, are well over the 160 column width.
    • Tests that write to the DB inside a thread should be fine, but prefer assertThat(...) over fail(...) where an assertion can express the check (awaitCondition).
  7. Test lanes. The *IT classes in the wire-protocol modules need the Failsafe setup. The PR text says they ran with -DskipITs=false. Please confirm they actually run in CI's normal lane. Otherwise the census will be green while the tests it points to never execute.
  8. Gremlin. The Cluster client is closed, but cluster.connect() creates a Client that is never closed separately. cluster.close() covers it, so this is fine. Just be sure the driver threads do not leak across tests.

No production code or security changes. No issues that block merging; 1 and 7 are the ones worth doing.

…ot from basedir, gate settings restored in their own finally, shorter HTTP test lines

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@claude

claude Bot commented Oct 18, 2026

Copy link
Copy Markdown

Review

Tests-only PR, and the design is good. The listener-on-record-create hook runs on the thread that executes the statement, so one check covers every protocol with no per-module test hooks. The census test turns "a new surface was added" into a CI failure. Config restore in finally and the QUERY_QUEUE_TIMEOUT=5s guard against a leaked slot are both sensible. I reviewed the shared helper, the census test and most of the per-module tests (the diff view I had was truncated, so I did not read the HTTP test or the tail of the census).

Suggestions (non-blocking)

  1. AdmissionSlotConformance cleanup: client.shutdownNow() does not wait for the request thread. If an assertion fails, the request thread may still be inside the surface when the finally restores QUERY_MAX_CONCURRENT, so a late slot release can leak into the next test. A short awaitTermination after shutdownNow() (or waiting for gate.getRunning()==0 in the finally) would make failures cleaner.
  2. Probe.onBeforeCreate swallows interrupts: on InterruptedException it re-sets the flag and returns true, so the record gets created anyway. That is fine for teardown, but a comment would say so.
  3. Gremlin test: GraphTraversalSource g is never closed. The Cluster.close() covers it in practice, but try (g) is tidier. The test also builds the cluster by hand, which duplicates setup other Gremlin ITs have, so check whether AbstractGremlinServerIT already offers a helper.
  4. Census test coverage gap: it only checks that the mapped test file exists and references the check. A test file that mentions assertGivesItsSlotBack without calling it (for example in a comment) would pass. Also confirm it fails on stale entries (a mapped class that no longer admits), so the map does not rot. System.getProperty("basedir", user.dir) plus .. is fragile if surefire is ever run from a different working directory.
  5. Tags and timeouts: TIMEOUT_MS = 60s is used as a hang detector, which matches the wall-clock guidance in CLAUDE.md. The suite is not benchmark-like, so no @Tag is needed. Confirm the *IT classes (Bolt, Postgres, gRPC, MCP) run under Failsafe in the existing lanes.
  6. Mongo and Redis: both depend on the BeforeRecordCreate hook firing for insertOne and HSET. If either path ever bypasses the type-level event, the test reports "request never created a record" after 60s. A faster, clearer failure would be to check answer.isDone() periodically while waiting for entered.
  7. Style: the CLAUDE.md rule about fully qualified names looks respected. The all-caps comments in the helper and census match how the surrounding tests are commented, so they're fine.

I did not run the tests locally.

Overall: LGTM with the minor items above.

🤖 Generated with Claude Code

… for the client thread before resetting the gate, close the Gremlin traversal source

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@claude

claude Bot commented Oct 18, 2026

Copy link
Copy Markdown

Review

Tests-only PR, and the design is good. A listener on the written type runs on whichever thread runs the statement, so one check works for every protocol. The census test stops the guard from rotting. The gRPC mutation proof is the right evidence that the check can fail. No security or production-performance concerns, since nothing under src/main changes.

I did not run the tests. This review is from reading AdmissionSlotConformance, AdmissionSurfaceCensusTest, and the Bolt, Gremlin and gRPC tests.

Suggestions (non-blocking)

  1. Census is textual.
    • source.contains("QueryAdmissionGate") && \.admit\( has gaps in both directions. A class that gets the gate through a helper or a differently named type, or that admits via another method name (tryAdmit, acquire), is missed. A comment or string that mentions the gate also counts.
    • The SURFACES map only checks that the test file contains assertGivesItsSlotBack(. A test that calls it for one entry point passes, even though the surface has several. The PR text says the per-test lists cover that, but nothing enforces it.
    • Both limits are acceptable. Consider stating them in the class Javadoc so nobody over-trusts the census.
  2. Path resolution in the census. REACTOR_ROOT is basedir or user.dir plus ... This breaks if the tests run from a copied or packaged module (e.g. a sandboxed test runner). The isRegularFile() assertion on the gate class makes it fail loudly, which is good. The basedir property is not set by default in Surefire, so a one-line comment on why user.dir is safe there would help.
  3. Shared mutable global state. QUERY_MAX_CONCURRENT and QUERY_QUEUE_TIMEOUT are saved and restored in finally, which is correct. But GlobalConfiguration.getValue() returns the current value, and the restore uses setValue(saved). If the original was the default, this writes it as an explicit override and isDefault() may change. Calling reset() when the saved value was the default would avoid that. Minor.
  4. Probe swallows a failed first create. armed fires only on the first record. If a surface retries the statement (e.g. a Bolt or HTTP transaction retry), the second run skips the hook and the request completes without the hold. The check then still passes the "released" assertions from the first run, so this is fine today. A short comment would save the next reader from wondering.
  5. Timeouts. The 60s TIMEOUT_MS and the 5s queue timeout are wall-clock bounds used as hang detectors, not latency assertions, so they comply with the StallAwareStopwatch rule. The 5s queue timeout is the one to watch. A stop-the-world pause longer than 5s between slot release and the next admit could turn a leaked slot into a spurious refusal. That is an unlikely flake. The failure message does make clear it is a refusal.
  6. Style.
    • Thread.currentThread().interrupt() in the probe, followed by return true, leaves the writer thread interrupted while it creates the record. That could make I/O on that thread fail with ClosedByInterruptException during teardown. Consider not restoring the flag, or only logging.
    • AdmissionSlotConformanceGremlinTest creates Cluster outside the try-with-resources and closes it in finally. That is fine, but the Client from cluster.connect() is never closed explicitly. cluster.close() covers it.
  7. Naming and tags. The *IT classes (Bolt, gRPC, MCP, Postgres) rely on Failsafe. The PR's test plan shows these ran via -DskipITs=false, so that is consistent. Please confirm CI actually runs the *IT lane for these modules. Otherwise the gRPC guard, the main point of the PR, silently never runs.

Overall this looks good to merge once point 7 is confirmed.

… back, keep the interrupt flag off the writer thread, state the census limits

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@claude

claude Bot commented Oct 18, 2026

Copy link
Copy Markdown

Review

Tests-only PR. The design is sound: a BeforeRecordCreateListener runs on the statement's own thread, so one check covers every protocol with no per-module hooks. The census test makes a new admitting surface fail CI until it has a conformance test. Teardown is careful: gate settings restored, hook released, client executor drained.

I read the shared helper (AdmissionSlotConformance) and the census test closely, and only skimmed the per-module tests.

Suggestions (none blocking)

  1. Census is a text match (source contains QueryAdmissionGate and a .admit( call). It misses a surface that reaches the gate through a helper class, and a comment or string with both tokens in an unrelated class would demand a mapping. Reasonable tradeoff; consider stripping comments before matching.
  2. Census only checks that the test text contains AdmissionSlotConformance.assertGivesItsSlotBack(. A @disabled test, or one calling it from a dead branch, still passes. Worth a Javadoc note.
  3. Gate state is JVM-wide. The helper sets QUERY_MAX_CONCURRENT=1 and waits for getRunning()==0. If tests run concurrently in the same JVM, or a prior test leaked a slot, this flakes or gates unrelated tests. Please confirm parallel execution is off for these modules, or add @isolated / @ResourceLock.
  4. Worst-case runtime is long. TIMEOUT_MS is 60s and is reused for awaitTermination after shutdownNow() and for the probe's proceed.await, so failure paths can stack to minutes. Fine as a hang detector, but a shorter wait in finally would do.
  5. REACTOR_ROOT is basedir/.. and needs sibling module sources. The isRegularFile assertion on the gate class fails loudly, which is good; an Assumptions skip would be friendlier for partial source trees.
  6. Style: ALL CAPS comments throughout the new files. Fine if that matches surrounding code, otherwise normalise. The swallowed InterruptedException in Probe is justified in a comment, which I appreciate.
  7. Please confirm the *IT classes (bolt, postgresw, mcp, grpcw) are picked up by their module's Failsafe config. The census only checks the files exist, not that they run.

Verdict: Looks good. No security or production-code risk. Items 3 and 7 are the ones worth confirming before merge.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.49%. Comparing base (1a8d72a) to head (754b3ed).

Additional details and impacted files
@@            Coverage Diff            @@
##               main   #10294   +/-   ##
=========================================
  Coverage     78.48%   78.49%           
- Complexity     4672     4673    +1     
=========================================
  Files          2263     2263           
  Lines        241123   241123           
  Branches      52279    52279           
=========================================
+ Hits         189254   189268   +14     
+ Misses        32312    32285   -27     
- Partials      19557    19570   +13     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@robfrank
robfrank merged commit 216847d into main Oct 18, 2026
@robfrank
robfrank deleted the feat/10235-admission-gate-conformance-test branch October 18, 2026 13:11
lvca added a commit that referenced this pull request Oct 20, 2026
…the overlay, the BM25 drift check compares the analyzer the lengths were measured with (#10456)

* fix(#10376,#10397): a deleted lightweight twin takes one twin out of the overlay, the BM25 drift check compares the analyzer the lengths were measured with

#10376: the overlay of a unidirectional type kept its deletions in a set keyed by the edge identity, which for a lightweight edge is the triple (type, out, in) its twins share, so one DELETE hid every twin of the pair from the incoming side for the rest of the statement. Deletions of lightweight edges are now kept per triple as a multiset of sequences, and each lookup takes one twin out per delete (the twins the transaction created first, then the last of the scanned ones). The twins a lookup answers are numbered across the scanned and the created ones, so a DELETE that claims each relationship by occurrence deletes every twin it matched, and a statement that deletes relationships and nodes together no longer finds a twin it already deleted.

#10397: the drift check compared the document count only. The sum of the lengths cannot be compared with the live data without analyzing it, so the counters are persisted with the analyzer (and the token-counting rule) they were measured with, and the first search rescans when it differs, even when the count agrees. Counters saved before the signature existed are trusted. schema:index shows measuredWith and measuredWithCurrentAnalyzer.

#10399 needs no change: the cross-surface conformance test it asks for exists (AdmissionSlotConformance and AdmissionSurfaceCensusTest, #10294).

* review(#10456): cheaper twin overlay when nothing twin-related changed, binary search of the tombstones, metadata-level tests of the analyzer signature, assertions that can fail

The overlay of the lightweight twins is built only when the transaction deleted twins or created some into the target, and its map of created twins is allocated with the first one. The tombstones of a triple are searched by halving. The analyzer signature gets metadata-level tests (round trip, length rule mismatch, legacy trust, a save before the rescan, an inexact scan, adoption, an explicit set). Two tests counted the records of lightweight edge types, which is always 0: they now count the vertices left and the edges through their lists.

* review(#10456): guards for the twin overlay lookup and the BM25 length rule

Tests pin that a lookup asked again in the same statement answers the same, that hundreds of twins are counted and numbered one per relationship, that the key of a tombstone is the triple alone, and that the rule counting the tokens of a document is tied to its version. The worked example in the overlay Javadoc and the reason an adopted pair takes its signature whole are written down.

* review(#10456): a randomized check of the twin overlay against a plain model, why the class names the analyzer

60 random statements over four pairs interleave creates and deletes after a read of the incoming side, and the last read has to answer a plain count per pair, each twin a relationship of its own. It fails with the drop of scanned twins disabled.

* review(#10456): the counter pair and its signature are published and saved as one unit, the analyzer warning carries the document counts, a later statement of the transaction ignores earlier deletes

A scan published its pair and its signature without the lock a save reads them under, so a save could record the new signature next to the pair from before the scan. Both now move under the counters lock, as the commit deltas and an adoption already do.

* review(#10456): the overlay Javadoc says which of its questions consume, the order dependence at the call site, the equality the key relies on, the rule behind the length version
robfrank added a commit that referenced this pull request Nov 5, 2026
robfrank pushed a commit that referenced this pull request Nov 5, 2026
…the overlay, the BM25 drift check compares the analyzer the lengths were measured with (#10456)

* fix(#10376,#10397): a deleted lightweight twin takes one twin out of the overlay, the BM25 drift check compares the analyzer the lengths were measured with

#10376: the overlay of a unidirectional type kept its deletions in a set keyed by the edge identity, which for a lightweight edge is the triple (type, out, in) its twins share, so one DELETE hid every twin of the pair from the incoming side for the rest of the statement. Deletions of lightweight edges are now kept per triple as a multiset of sequences, and each lookup takes one twin out per delete (the twins the transaction created first, then the last of the scanned ones). The twins a lookup answers are numbered across the scanned and the created ones, so a DELETE that claims each relationship by occurrence deletes every twin it matched, and a statement that deletes relationships and nodes together no longer finds a twin it already deleted.

#10397: the drift check compared the document count only. The sum of the lengths cannot be compared with the live data without analyzing it, so the counters are persisted with the analyzer (and the token-counting rule) they were measured with, and the first search rescans when it differs, even when the count agrees. Counters saved before the signature existed are trusted. schema:index shows measuredWith and measuredWithCurrentAnalyzer.

#10399 needs no change: the cross-surface conformance test it asks for exists (AdmissionSlotConformance and AdmissionSurfaceCensusTest, #10294).

* review(#10456): cheaper twin overlay when nothing twin-related changed, binary search of the tombstones, metadata-level tests of the analyzer signature, assertions that can fail

The overlay of the lightweight twins is built only when the transaction deleted twins or created some into the target, and its map of created twins is allocated with the first one. The tombstones of a triple are searched by halving. The analyzer signature gets metadata-level tests (round trip, length rule mismatch, legacy trust, a save before the rescan, an inexact scan, adoption, an explicit set). Two tests counted the records of lightweight edge types, which is always 0: they now count the vertices left and the edges through their lists.

* review(#10456): guards for the twin overlay lookup and the BM25 length rule

Tests pin that a lookup asked again in the same statement answers the same, that hundreds of twins are counted and numbered one per relationship, that the key of a tombstone is the triple alone, and that the rule counting the tokens of a document is tied to its version. The worked example in the overlay Javadoc and the reason an adopted pair takes its signature whole are written down.

* review(#10456): a randomized check of the twin overlay against a plain model, why the class names the analyzer

60 random statements over four pairs interleave creates and deletes after a read of the incoming side, and the last read has to answer a plain count per pair, each twin a relationship of its own. It fails with the drop of scanned twins disabled.

* review(#10456): the counter pair and its signature are published and saved as one unit, the analyzer warning carries the document counts, a later statement of the transaction ignores earlier deletes

A scan published its pair and its signature without the lock a save reads them under, so a save could record the new signature next to the pair from before the scan. Both now move under the counters lock, as the commit deltas and an adoption already do.

* review(#10456): the overlay Javadoc says which of its questions consume, the order dependence at the call site, the equality the key relies on, the rule behind the length version

(cherry picked from commit ba9ec14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conformance test: every admission-gate surface must give its slot back from the thread that runs the statement (follow-up of #10140)

1 participant