testdrive: fix catalog consistency check failure without license key#35401
Open
aljoscha wants to merge 1 commit intoMaterializeInc:mainfrom
Open
testdrive: fix catalog consistency check failure without license key#35401aljoscha wants to merge 1 commit intoMaterializeInc:mainfrom
aljoscha wants to merge 1 commit intoMaterializeInc:mainfrom
Conversation
The testdrive binary was using `ValidatedLicenseKey::default()` when no license key was provided, while environmentd uses `ValidatedLicenseKey::disabled()` in the same scenario (non-Kubernetes, no `--license-key` flag). These two defaults differ in `allow_credit_consumption_override`: - `default()`: `false` → `credit_consumption_from_memory = true` - `disabled()`: `true` → `credit_consumption_from_memory = false` This caused a mismatch in `credits_per_hour` during the catalog consistency check. Environmentd would keep the JSON-provided credits value (e.g., 1), while testdrive's independent catalog open would recalculate credits from memory limits (e.g., 4 GiB / 1 GiB = 4). The consistency check then failed with a `credits_per_hour` lsu array diff. In CI this was masked because `MZ_CI_LICENSE_KEY` is always set, so both environmentd and testdrive use the same validated license key. Fix by using `ValidatedLicenseKey::disabled()` in testdrive to match environmentd's behavior when no license key is provided. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks for opening this PR! Here are a few tips to help make the review process smooth for everyone. PR title guidelines
Pre-merge checklist
|
mtabebe
approved these changes
Mar 10, 2026
def-
approved these changes
Mar 10, 2026
bkirwi
approved these changes
Mar 10, 2026
Contributor
bkirwi
left a comment
There was a problem hiding this comment.
I think I've run into this before but never looked into it... thank you!
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.
The testdrive binary was using
ValidatedLicenseKey::default()when no license key was provided, while environmentd usesValidatedLicenseKey::disabled()in the same scenario (non-Kubernetes, no--license-keyflag).These two defaults differ in
allow_credit_consumption_override:default():false→credit_consumption_from_memory = truedisabled():true→credit_consumption_from_memory = falseThis caused a mismatch in
credits_per_hourduring the catalog consistency check. Environmentd would keep the JSON-provided credits value (e.g., 1), while testdrive's independent catalog open would recalculate credits from memory limits (e.g., 4 GiB / 1 GiB = 4). The consistency check then failed with acredits_per_hourlsu array diff.In CI this was masked because
MZ_CI_LICENSE_KEYis always set, so both environmentd and testdrive use the same validated license key.Fix by using
ValidatedLicenseKey::disabled()in testdrive to match environmentd's behavior when no license key is provided.