Skip to content

test: pernot's wait budget was exactly its notification interval - #57

Merged
kzangeli merged 1 commit into
mainfrom
test/pernot-wait-budget-vs-interval
Sep 3, 2026
Merged

test: pernot's wait budget was exactly its notification interval#57
kzangeli merged 1 commit into
mainfrom
test/pernot-wait-budget-vs-interval

Conversation

@kzangeli

@kzangeli kzangeli commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

My own regression, from #54 earlier today.

That PR swapped sleep 3 for ftClientWait 2 — the right shape, waiting for the event instead of guessing a duration. But ftClientWait's budget is 100 × 0.02s = 2s, and the subscription's timeInterval was 2. The second notification is due at t≈2.0s, exactly when the wait gives up.

So the test raced its own helper:

03. Wait for the second periodic notification
==============================================
                       <- "two notifications arrived" missing: the && never fired

It lost on corDB (585/586 in tonight's run) and won on mongoc — and it won all three valgrind runs I verified #54 with, because under valgrind the budget is multiplied by 5, to 10s, and the race disappears. I verified the new test under the condition that hides the defect and not under the one that shows it.

timeInterval=1 puts the two notifications at t≈0 and t≈1, inside the 2s budget on either backend, and leaves the point of #54 intact: the subscription is deleted before anything asserts that nothing more arrives.

The reason is recorded in the test header, since the next person to see a slow pernot test will reach for a bigger interval, which is the change that breaks it.

Verified: mongoc 1/1, corDB 5/5, valgrind 3/3.

My own regression, from the rewrite two commits ago. That change swapped
`sleep 3` for `ftClientWait 2`, which is the right shape - wait for the
event instead of guessing a duration - but ftClientWait's budget is
100 x 0.02s = 2s, and the subscription's timeInterval was 2. The second
notification is therefore due at t=2.0s, exactly when the wait gives up.

So the test raced its own helper. It lost on corDB (585/586 in tonight's
run) and won on mongoc, and it won all three valgrind runs I verified it
with - because under valgrind the budget is multiplied by 5, to 10s, and
the race disappears. I verified the new test under the condition that
hides the defect and not under the one that shows it.

timeInterval=1 puts the two notifications at t=0 and t=1, inside the 2s
budget on either backend, and leaves the point of the rewrite intact: the
subscription is deleted before anything asserts that nothing more arrives.

Verified mongoc 1/1, corDB 5/5, valgrind 3/3.
@kzangeli
kzangeli merged commit 785b6c3 into main Sep 3, 2026
7 checks passed
@kzangeli
kzangeli deleted the test/pernot-wait-budget-vs-interval branch September 3, 2026 19:05
kzangeli added a commit that referenced this pull request Sep 3, 2026
The pushdown builds one positive per-instance predicate and negates the
whole thing for != and !~=. The positive carries a type check inside it,
so negating it turns "wrong type" into "matches" - which § 7.2.3.3 says
is right for one operator and wrong for the other:

  !=    "if the data type of the target value and the data type of the
         Query Term value are different, then they shall be considered
         UNEQUAL"                                  -> mismatch MATCHES
  !~=   "if the target value data type is different than String then it
         shall be considered as NOT MATCHING"

So q=a.b.c!~=alp returned the entities whose a.b.c is 3 and 7. A number is
not "a value that does not match /alp/"; it is a value the operator cannot
be applied to.

For a pattern the string check is therefore asserted POSITIVELY, outside
the negation, and only the regex is negated. != keeps the guard inside,
where the spec wants it.

corNgsild#9 fixes the mirror-image bug in the in-broker matcher, which had
the other rule: every type guard there answered plain false - right for
!~= and wrong for !=. Each backend implemented exactly one of the two.

query_q_negation_type_rules.test pins both directions, and needs nothing
to be an oracle: no REQUIRE_DB, so the harness runs it against both
backends, and they evaluate `q` in completely different places. It holds
string targets where the query term is a number AND numeric targets where
it is a string, so neither backend can pass by implementing one rule.

636/636 mongoc, 585/586 corDB (subscription_pernot, unrelated - #57).
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.

1 participant