2046_fabricx_public_params_setup_returns_errors - #2246
Draft
HayimShaul wants to merge 1 commit into
Draft
Conversation
The fabricx token backend panicked when the SetupPublicParams view failed, and it did so on a background goroutine, so the whole test process died with `panic: failed updating pps` instead of the suite reporting a failure. It also panicked when the issuer client never became ready, and inside common.JSONMarshall, whose failure mode is a gomega assertion. InstallPublicParams and UpdatePublicParams now return an error, and so does the fabric.Backend interface they implement. The background installation records its outcome, including a recovered panic, and NetworkHandler surfaces it: UpdatePublicParams fails fast with the original error, Cleanup logs it at teardown, and WaitForPublicParams lets a test block on it. Errors become gomega assertions at the NetworkHandler boundary, so the NWO platform API is unchanged. Adds unit tests for both paths, including a regression test that runs the failing installation in a child process to prove it no longer crashes, and documents where the failure surfaces in the integration-test debugging doc. Signed-off-by: Hayim.Shaul@ibm.com <hayimsha@fhe03.vpc.cloud9.ibm.com>
HayimShaul
force-pushed
the
2046_fabricx_public_params_setup_returns_errors
branch
from
August 18, 2026 09:28
ec518cc to
ee6fa0c
Compare
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.
Fixes #2046
fabricx.Backend.InstallPublicParamsandUpdatePublicParamspanicked instead ofreporting failures:
UpdatePublicParamsdereferenced a nil issuer client, both panicked ona
SetupPublicParamsview error, and the install variant did so from a backgroundgoroutine, which took the whole test process down with
panic: failed updating pps.Both now return an error, and so does the
fabric.Backendinterface they implement:recover()) and records its outcome per TMS;WaitForPublicParamsblocks on it,PendingInstallErrorpolls it;UpdatePublicParamswaits for the issuer client the way the install path does, so anot-yet-started issuer node is a wait rather than a nil-interface panic. The retry budget
is configurable (
ClientRetries,ClientRetryDelay,InstallDelay), defaulting totoday's 60 attempts / 1s / 10s;
fabric.NetworkHandlerconverts the errors into gomega failures (PostRun,UpdatePublicParams) and logs a still-pending install failure inCleanup, so the NWOplatform API is unchanged;
cc.GenericBackendfollows the new signatures and returns its chaincode lookup,mkdir and packaging failures as errors;
encoding/jsoninstead ofcommon.JSONMarshall,whose failure mode is a gomega assertion — another hidden panic on this very path.
Behaviour change worth calling out: an installation that failed in the background used to
crash the run, or pass unnoticed. It now fails the spec that updates the public parameters,
carrying the original error, or is logged at teardown.
Tests:
integration/nwo/token/fabricx/factory_test.gocovers both paths, a recoveredpanic, the wait timeout and the exact payload sent to the view.
TestInstallPublicParamsBackgroundFailureDoesNotCrashProcessre-executes the failinginstallation in a child process — the only way to assert that the goroutine no longer kills
the runner — and it fails if the panic is reintroduced.
make checksis green.make lintreports only findings already present onmain(verified by linting a clean
origin/mainworktree); this change adds none.Docs:
docs/development/debug-integration-tests.mdgains a section on where a publicparameters setup failure now surfaces.