You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
• Modified counter test assertion to expect 999n instead of 1n
• Intentionally breaks test to validate CI failure detection
Diagram
flowchart LR
A["Counter Test"] -- "assertion changed" --> B["expect 999n instead of 1n"]
B -- "result" --> C["Test Fails"]
Loading
File Changes
1. src/ts/counter.test.ts
🧪 Tests +1/-1
Flip counter assertion to fail test
• Changed assertion in counter test from toBe(1n) to toBe(999n)
• Test now expects incorrect counter value to intentionally fail
• Validates CI pipeline failure detection capability
src/ts/counter.test.ts now asserts the counter equals 999n after a single increment(), but the
contract increments by exactly 1, so the test will always fail and block CI/merges.
The modified TS test expects 999n after one increment, but the contract writes current_value + 1
and the Noir tests assert the post-increment value is 1, proving the new expectation is incorrect.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The `Counter Contract` e2e test expects the counter to be `999n` after one increment, but the contract increments the stored value by `+1`. This makes the test deterministically fail.
## Issue Context
The Noir contract implementation and its Noir unit tests both indicate that calling `increment()` once results in the counter value `1`.
## Fix Focus Areas
- src/ts/counter.test.ts[44-56]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Author self-review: I have reviewed the code review findings, and addressed the relevant ones.
src/ts/counter.test.ts now asserts the counter equals 999n after a single increment(), but the
contract increments by exactly 1, so the test will always fail and block CI/merges.
The modified TS test expects 999n after one increment, but the contract writes current_value + 1
and the Noir tests assert the post-increment value is 1, proving the new expectation is incorrect.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The `Counter Contract` e2e test expects the counter to be `999n` after one increment, but the contract increments the stored value by `+1`. This makes the test deterministically fail.
## Issue Context
The Noir contract implementation and its Noir unit tests both indicate that calling `increment()` once results in the counter value `1`.
## Fix Focus Areas
- src/ts/counter.test.ts[44-56]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The reason will be displayed to describe this comment to others. Learn more.
1. Failing counter expectation 🐞 Bug≡ Correctness
src/ts/counter.test.ts now asserts the counter equals 999n after a single increment(), but the
contract increments by exactly 1, so the test will always fail and block CI/merges.
Agent Prompt
## Issue description
The `Counter Contract` e2e test expects the counter to be `999n` after one increment, but the contract increments the stored value by `+1`. This makes the test deterministically fail.
## Issue Context
The Noir contract implementation and its Noir unit tests both indicate that calling `increment()` once results in the counter value `1`.
## Fix Focus Areas
- src/ts/counter.test.ts[44-56]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Failed test name: src/ts/counter.test.ts > Counter Contract > e2e
Failure summary:
The action failed because the JavaScript test suite (yarn test:js / vitest run) had a failing test assertion. - Failed test: src/ts/counter.test.ts > Counter Contract > e2e - Error: AssertionError: expected 1n to be 999n - Location: src/ts/counter.test.ts:55:7 where the code asserts .toBe(999n) but the actual received value was 1n. Note: The earlier message about run-codegen requires run-compile appears in a conditional that did not trigger (the condition includes "true" = "false"), so it did not cause the failure.
Relevant error logs:
1: ##[group]Runner Image Provisioner2: Hosted Compute Agent
...
167: Turn off this advice by setting config variable advice.detachedHead to false168: HEAD is now at 1cd96dc Merge d05889d5f291750cdf89ddde3d5a405fb28440c4 into 832eda16fe79556a58a2985de02a94f04ad8d343169: ##[endgroup]170: [command]/usr/bin/git log -1 --format=%H171: 1cd96dc47c73103af609029fdbf1eaab709128a1172: ##[group]Run defi-wonderland/aztec-ci-actions/actions/setup-aztec@v0173: with:174: start-pxe: true175: run-codegen: true176: working-directory: .177: run-compile: true178: foundry-version: v1.4.1179: ##[endgroup]180: ##[group]Run if [ "true" = "true" ] && [ "true" = "false" ]; then181: �[36;1mif [ "true" = "true" ] && [ "true" = "false" ]; then�[0m182: �[36;1m echo "::error::run-codegen requires run-compile (codegen needs compile artifacts); set run-compile to true"�[0m183: �[36;1m exit 1�[0m
...
289: ##[endgroup]290: anvil Version: 1.4.1-v1.4.1291: Commit SHA: cf7746048646f2ecff48246dd61e265e49ab16f0292: Build Timestamp: (1760449749)293: Build Profile: maxperf294: _295: /\ | |296: / \ ___| |_ ___ ___ 297: / /\ \ |_ / __/ _ \/ __|298: / ____ \ / /| || __/ (__ 299: /_/___ \_\/___|\__\___|\___|300: https://github.com/AztecProtocol301: Setting up Aztec local network 4.3.0, please stand by...302: Setting up test accounts303: [13:08:46.667] �[32mINFO�[39m: �[36m�[1mworld-state:database�[22m �[0mCreating world state data store at directory /tmp/aztec-world-state-uR2cIh/world_state with map sizes {"archiveTreeMapSizeKb":10485760,"nullifierTreeMapSizeKb":10485760,"noteHashTreeMapSizeKb":10485760,"messageTreeMapSizeKb":10485760,"publicDataTreeMapSizeKb":10485760} and 16 threads.�[0m�[39m
304: [13:08:46.739] �[32mINFO�[39m: �[36m�[1methereum:deploy_aztec_l1_contracts�[22m �[0mDeploying L1 contracts with config: {"ethereumSlotDuration":12,"aztecSlotDuration":72,"aztecEpochDuration":2,"aztecTargetCommitteeSize":0,"lagInEpochsForValidatorSet":2,"lagInEpochsForRandao":1,"inboxLag":1,"aztecProofSubmissionEpochs":1,"activationThreshold":"100000000000000000000","ejectionThreshold":"50000000000000000000","localEjectionThreshold":"98000000000000000000","slashingOffsetInRounds":2,"slasherFlavor":"none","slashAmountSmall":"10000000000000000000","slashAmountMedium":"20000000000000000000","slashAmountLarge":"50000000000000000000","slashingRoundSizeInEpochs":4,"slashingLifetimeInRounds":5,"slashingExecutionDelayInRounds":0,"slashingVetoer":"0x0000000000000000000000000000000000000000","slashingDisableDuration":432000,"governanceProposerRoundSize":300,"governanceVotingDuration":3600,"manaTarget":"100000000","provingCostPerMana":"100","initialEthPerFeeAsset":"10000000","exitDelaySeconds":172800,"gasLimitBufferPercentage":20,"maxGwei":2000,"maxBlobGwei":3000,"priorityFeeBumpPercentage":20,"priorityFeeRetryBumpPercentage":50,"minimumPriorityFeePerGas":0,"maxSpeedUpAttempts":3,"checkIntervalMs":1000,"stallTimeMs":12000,"txTimeoutMs":120000,"cancelTxOnTimeout":true,"txCancellationFinalTimeoutMs":288000,"txUnseenConsideredDroppedMs":72000,"enableDelayer":false,"dataStoreMapSizeKb":134217728,"l1Contracts":{},"l1RpcUrls":["http://127.0.0.1:8545"],"blobAllowEmptySources":false,"l1ChainId":31337,"archiverPollingIntervalMS":500,"archiverBatchSize":100,"maxLogs":1000,"skipValidateCheckpointAttestations":false,"maxAllowedEthClientDriftSeconds":300,"ethereumAllowNoDebugHosts":true,"l1DebugRpcUrls":[],"viemPollingIntervalMS":1000,"validatorPrivateKeys":"[Redacted]","validatorAddresses":[],"disableValidator":false,"disabledValidators":[],"attestationPollingIntervalMs":200,"validatorReexecute":true,"alwaysReexecuteBlockProposals":true,"fishermanMode":false,"skipCheckpointProposalValidation":false,"skipPushProposedBlocksToArchiver":false,"attestToEquivocatedProposals":false,"haSigningEnabled":false,"nodeId":"","pollingIntervalMs":100,"signingTimeoutMs":3000,"poolMaxCount":10,"poolMinCount":0,"poolIdleTimeoutMs":10000,"poolConnectionTimeoutMs":0,"sequencerPollingIntervalMS":500,"minTxsPerBlock":1,"publishTxsWithProposals":false,"perBlockAllocationMultiplier":1.2,"redistributeCheckpointBudget":true,"coinbase":"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266","enforceTimeTable":true,"attestationPropagationTime":2,"secondsBeforeInvalidatingBlockAsCommitteeMember":144,"secondsBeforeInvalidatingBlockAsNonCommitteeMember":432,"skipCollectingAttestations":false,"skipInvalidateBlockAsProposer":false,"broadcastInvalidBlockProposal":false,"injectFakeAttestation":false,"injectHighSValueAttestation":false,"injectUnrecoverableSignatureAttestation":false,"shuffleAttestationOrdering":false,"expectedBlockProposalsPerSlot":0,"buildCheckpointIfEmpty":false,"skipPublishingCheckpointsPercent":0,"txPublicSetupAllowListExtend":[{"classId":"0x1acd27d34100bbaeb71decf873e5b15d3029ed9547d0d696b5386972a00be2e8","selector":"0xe7f045ff","calldataLength":3,"onlySelf":true},{"classId":"0x1acd27d34100bbaeb71decf873e5b15d3029ed9547d0d696b5386972a00be2e8","selector":"0x8c9e5472","calldataLength":5}],"sequencerPublisherPrivateKeys":["[Redacted]"],"sequencerPublisherAddresses":[],"sequencerPublisherAllowInvalidStates":true,"bbSkipCleanup":false,"numConcurrentIVCVerifiers":8,"bbIVCConcurrency":1,"realProofs":false,"proverTestDelayType":"fixed","proverTestDelayMs":0,"proverTestDelayFactor":1,"proverAgentCount":1,"cancelJobsOnStop":false,"enqueueConcurrency":50,"proverAgentPollIntervalMs":1000,"proverTestVerificationDelayMs":10,"proverBrokerJobTimeoutMs":30000,"proverBrokerPollIntervalMs":1000,"proverBrokerJobMaxRetries":3,"proverBrokerBatchSize":100,"proverBrokerBatchIntervalMs":50,"proverBrokerMaxEpochsToKeepResultsFor":1,"proverBrokerDebugReplayEnabled":false,"proverPublisherAllowInvalidStates":true,"proverPublisherPrivateKeys":[],"proverPublisherAddresses":[],"proverNodeMaxPendingJobs":10,"proverNodePollingIntervalMs":1000,"proverNodeMaxParallelBlocksPerEpoch":0,"txGatheringIntervalMs":1000,"txGatheringBatchSize":10,"txGatheringMaxParallelRequestsPerNode":100,"txGatheringTimeoutMs":120000,"proverNodeDisableProofPublish":false,"worldStateBlockCheckIntervalMS":500,"worldStateCheckpointHistory":64,"p2pEnabled":false,"p2pDiscoveryDisabled":false,"blockCheckIntervalMS":500,"slotCheckIntervalMS":1000,"debugDisableColocationPenalty":false,"peerCheckIntervalMS":30000,"l2QueueSize":1000,"listenAddress":"0.0.0.0","p2pPort":40400,"bootstrapNodes":[],"bootstrapNodeEnrVersionCheck":false,"bootstrapNodesAsFullPeers":false,"maxPeerCount":100,"queryForIp":false,"gossipsubInterval":700,"gossipsubD":8,"gossipsubDlo":4,"gossipsubDhi":12,"gossipsubDLazy":8,"gossipsubFloodPublish":false,"gossipsubMcacheLength":6,"gossipsubMcacheGossip":3,"gossipsubSeenTTL":1200000,"gossipsubTxTopicWeight":1,"gossipsubTxInvalidMessageDeliveriesWeight":-20,"gossipsubTxInvalidMessageDeliveriesDecay":0.5,"peerPenaltyValues":[2,10,50],"doubleSpendSeverePeerPenaltyWindow":30,"blockRequestBatchSize":20,"archivedTxLimit":0,"trustedPeers":[],"privatePeers":[],"preferredPeers":[],"maxPendingTxCount":1000,"seenMessageCacheSize":100000,"p2pDisableStatusHandshake":false,"p2pAllowOnlyValidators":false,"p2pMaxFailedAuthAttemptsAllowed":3,"dropTransactions":false,"dropTransactionsProbability":0,"disableTransactions":false,"txPoolDeleteTxsAfterReorg":false,"debugP2PInstrumentMessages":false,"broadcastEquivocatedProposals":false,"minTxPoolAgeMs":2000,"priceBumpPercentage":"10","overallRequestTimeoutMs":10000,"individualRequestTimeoutMs":10000,"dialTimeoutMs":5000,"p2pOptimisticNegotiation":false,"batchTxRequesterSmartParallelWorkerCount":10,"batchTxRequesterDumbParallelWorkerCount":10,"batchTxRequesterTxBatchSize":8,"batchTxRequesterBadPeerThreshold":2,"txCollectionFastNodesTimeoutBeforeReqRespMs":200,"txCollectionSlowNodesIntervalMs":12000,"txCollectionSlowReqRespIntervalMs":12000,"txCollectionSlowReqRespTimeoutMs":20000,"txCollectionReconcileIntervalMs":60000,"txCollectionDisableSlowDuringFastRequests":true,"txCollectionFastNodeIntervalMs":500,"txCollectionNodeRpcUrls":[],"txCollectionFastMaxParallelRequestsPerNode":4,"txCollectionNodeRpcMaxBatchSize":50,"txCollectionMissingTxsCollectorType":"new","txCollectionFileStoreUrls":[],"txCollectionFileStoreSlowDelayMs":24000,"txCollectionFileStoreFastDelayMs":2000,"txCollectionFileStoreFastWorkerCount":5,"txCollectionFileStoreSlowWorkerCount":2,"txCollectionFileStoreFastBackoffBaseMs":1000,"txCollectionFileStoreSlowBackoffBaseMs":5000,"txCollectionFileStoreFastBackoffMaxMs":5000,"txCollectionFileStoreSlowBackoffMaxMs":30000,"txFileStoreUploadConcurrency":10,"txFileStoreMaxQueueSize":1000,"txFileStoreEnabled":false,"sentinelHistoryLengthInEpochs":24,"sentinelHistoricProvenPerformanceLengthInEpochs":2000,"sentinelEnabled":false,"testAccounts":true,"sponsoredFPC":false,"prefundAddresses":[],"syncMode":"snapshot","snapshotsUrls":[],"debugForceTxProofVerification":false,"enableVersionCheck":true,"rpcSimulatePublicMaxGasLimit":10000000000,"rpcSimulatePublicMaxDebugLogMemoryReads":125000,"rpcMaxBatchSize":100,"rpcMaxBodySize":"1mb","slashMinPenaltyPercentage":0.5,"slashMaxPenaltyPercentage":2,"slashValidatorsAlways":[],"slashValidatorsNever":[],"slashPrunePenalty":"10000000000000000000","slashDataWithholdingPenalty":"10000000000000000000","slashBroadcastedInvalidBlockPenalty":"10000000000000000000","slashDuplicateProposalPenalty":"0","slashDuplicateAttestationPenalty":"0","slashInactivityTargetPercentage":0.9,"slashInactivityConsecutiveEpochThreshold":1,"slashInactivityPenalty":"10000000000000000000","slashProposeInvalidAttestationsPenalty":"10000000000000000000","slashAttestDescendantOfInvalidPenalty":"10000000000000000000","slashUnknownPenalty":"10000000000000000000","slashOffenseExpirationRounds":4,"slashMaxPayloadSize":50,"slashGracePeriodL2Slots":0,"slashExecuteRoundsLookBack":4,"slashSelfAllowed":false,"skipArchiverInitialSync":false,"enableProverNode":false,"l1Mnemonic":"test test test test test test test test test test test junk","vkTreeRoot":"0x1dd2644a17d1ddd8831287a78c5a1033b7ae35cdf2a3db833608856c062fc2ba","protocolContractsHash":"0x2672340d9a0107a7b81e6d10d25b854debe613f3272e8738e8df0ca2ff297141","genesisArchiveRoot":"0x1b72267a6ac261ada1badb62b5d94f2ca48afbb435ff09fee05e353a158fc0f4","feeJuicePortalInitialBalance":"50000000000000000000000","realVerifier":false}�[0m�[39m
305: [13:08:46.758] �[32mINFO�[39m: �[36m�[1methereum:deploy_aztec_l1_contracts�[22m �[0mSent 0.1 ETH to deployer�[0m�[39m �[90m{"deployer":"0x05f32b3cc3888453ff71b01135b34ff8e41263f2","value":"100000000000000000"}�[39m
...
428: Updating files: 90% (10909/12121)429: Updating files: 91% (11031/12121)430: Updating files: 92% (11152/12121)431: Updating files: 93% (11273/12121)432: Updating files: 94% (11394/12121)433: Updating files: 95% (11515/12121)434: Updating files: 96% (11637/12121)435: Updating files: 97% (11758/12121)436: Updating files: 98% (11879/12121)437: Updating files: 99% (12000/12121)438: Updating files: 100% (12121/12121)439: Updating files: 100% (12121/12121), done.440: Cloning into '/home/runner/nargo/github.com/noir-lang/poseidon/v0.3.0'...441: Cloning into '/home/runner/nargo/github.com/noir-lang/sha256/v0.3.0'...442: WARNING: Found tests in contract crate(s):443: counter_contract::test::increment::does_it_fail_to_call_the_initializer444: counter_contract::test::increment::increment_success445: Tests should be in a dedicated test crate, not in the contract crate.446: Learn more: https://docs.aztec.network/errors/1447: Postprocessing contracts...
...
453: Generating verification key: cbb0**********************************************************26 (mem: 26.35 MiB)454: ChonkComputeVk - deriving MegaVerificationKey for circuit 'increment' (mem: 26.35 MiB)455: ChonkComputeVk - VK derived, size: 4064 bytes (mem: 50.93 MiB)456: Successfully processed: target/counter_contract-Counter.json -> target/counter_contract-Counter.json (mem: 50.93 MiB)457: Compilation complete!458: ##[group]Run aztec codegen target --outdir src/artifacts -f459: �[36;1maztec codegen target --outdir src/artifacts -f�[0m460: shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}461: ##[endgroup]462: ##[group]Run echo "Waiting for local network on port 8080..."463: �[36;1mecho "Waiting for local network on port 8080..."�[0m464: �[36;1mtimeout=120�[0m465: �[36;1melapsed=0�[0m466: �[36;1mwhile ! nc -z localhost 8080 2>/dev/null; do�[0m467: �[36;1m if [ $elapsed -ge $timeout ]; then�[0m468: �[36;1m echo "::error::Timed out waiting for port 8080 after ${timeout}s"�[0m469: �[36;1m exit 1�[0m
...
484: working-directory: .485: ##[endgroup]486: ##[group]Run script -e -c "BASE_PXE_URL=http://localhost NODE_NO_WARNINGS=1 yarn test:js"487: �[36;1mscript -e -c "BASE_PXE_URL=http://localhost NODE_NO_WARNINGS=1 yarn test:js"�[0m488: shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}489: ##[endgroup]490: Script started, output log file is 'typescript'.491: yarn run v1.22.22492: $ vitest run493: �[?25l494: �[1m�[46m RUN �[49m�[22m �[36mv4.0.17 �[39m�[90m/home/runner/work/aztec-boilerplate/aztec-boilerplate�[39m495: Sourcemap for "/home/runner/work/aztec-boilerplate/aztec-boilerplate/node_modules/@aztec/bb.js/dest/node/cbind/generated/async.js" points to missing source files496: Sourcemap for "/home/runner/work/aztec-boilerplate/aztec-boilerplate/node_modules/@aztec/bb.js/dest/node/cbind/generated/api_types.js" points to missing source files497: Sourcemap for "/home/runner/work/aztec-boilerplate/aztec-boilerplate/node_modules/@aztec/bb.js/dest/node/cbind/generated/sync.js" points to missing source files498: Sourcemap for "/home/runner/work/aztec-boilerplate/aztec-boilerplate/node_modules/@aztec/bb.js/dest/node/cbind/generated/curve_constants.js" points to missing source files499: �[31m❯�[39m src/ts/counter.test.ts �[2m(�[22m�[2m1 test�[22m�[2m | �[22m�[31m1 failed�[39m�[2m)�[22m�[33m 12387�[2mms�[22m�[39m500: �[31m �[31m×�[31m e2e�[39m�[33m 11848�[2mms�[22m�[39m501: �[31m⎯⎯⎯⎯⎯⎯⎯�[39m�[1m�[41m Failed Tests 1 �[49m�[22m�[31m⎯⎯⎯⎯⎯⎯⎯�[39m502: �[41m�[1m FAIL �[22m�[49m src/ts/counter.test.ts�[2m > �[22mCounter Contract�[2m > �[22me2e503: �[31m�[1mAssertionError�[22m: expected 1n to be 999n // Object.is equality�[39m504: �[32m- Expected�[39m505: �[31m+ Received�[39m506: �[32m- 999n�[39m507: �[31m+ 1n�[39m508: �[36m �[2m❯�[22m src/ts/counter.test.ts:�[2m55:7�[22m�[39m509: �[90m 53| �[39m })510: �[90m 54| �[39m )�[33m.�[39mresult�[33m,�[39m511: �[90m 55| �[39m )�[33m.�[39m�[34mtoBe�[39m(�[34m999n�[39m)�[33m;�[39m512: �[90m | �[39m �[31m^�[39m513: �[90m 56| �[39m })�[33m;�[39m514: �[90m 57| �[39m})�[33m;�[39m515: �[31m�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯�[22m�[39m516: �[2m Test Files �[22m �[1m�[31m1 failed�[39m�[22m�[90m (1)�[39m517: �[2m Tests �[22m �[1m�[31m1 failed�[39m�[22m�[90m (1)�[39m518: �[2m Start at �[22m 13:09:22519: �[2m Duration �[22m 17.36s�[2m (transform 3.38s, setup 0ms, import 4.85s, tests 12.39s, environment 0ms)�[22m520: ##[error]AssertionError: expected 1n to be 999n // Object.is equality521:
522: - Expected523: + Received524:
525: - 999n526: + 1n527:
528: ❯ src/ts/counter.test.ts:55:7529:
530:
531: �[?25h532: error Command failed with exit code 1.533: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.534: Script done.535: ##[error]Process completed with exit code 1.536: Post job cleanup.
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 freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
1 participant
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.
Test PR.