Skip to content

fix: flaky integration test#91

Open
lpahlavi wants to merge 4 commits intomainfrom
lpahlavi/fix-flaky-integration-test
Open

fix: flaky integration test#91
lpahlavi wants to merge 4 commits intomainfrom
lpahlavi/fix-flaky-integration-test

Conversation

@lpahlavi
Copy link
Contributor

@lpahlavi lpahlavi commented Mar 4, 2026

This PR fixes a faulty test assertion which led to the should_make_batch_json_rpc_request being flaky. The test previously asserted that the result of the Solana JSON-RPC getSlotLeader call should be a 44-character string. However, this is not always the case (see the Solana docs here), so the assertion is relaxed to simply check the string is not empty.

@lpahlavi lpahlavi requested a review from gregorydemay March 4, 2026 09:36
@lpahlavi lpahlavi marked this pull request as ready for review March 4, 2026 09:40
@lpahlavi lpahlavi requested a review from a team as a code owner March 4, 2026 09:40
Comment on lines +30 to +32
assert!(Regex::new(SOLANA_PUBKEY_REGEX)
.unwrap()
.is_match(&result.leader));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

understanding question: why do we need to verify that this is syntactically correct Solana public key? This is after all a canhttp example (not specific to Solana)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not super strictly needed, I just wanted to add a sanity check that the results somewhat makes sense. I could also just have assert!(result.leader().len() > 0) or so... WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I just relaxed the assertion to assert!(result.leader().len() > 0) since you are right, the regex was overkill here.

@lpahlavi lpahlavi requested a review from gregorydemay March 4, 2026 10:20
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.

2 participants