Skip to content

fix: mark epoch-specific validators doctest as no_run#185

Open
r-near wants to merge 1 commit intonear:masterfrom
r-near:fix/validators-doctest-no-run
Open

fix: mark epoch-specific validators doctest as no_run#185
r-near wants to merge 1 commit intonear:masterfrom
r-near:fix/validators-doctest-no-run

Conversation

@r-near
Copy link
Contributor

@r-near r-near commented Feb 10, 2026

Summary

  • Mark the EpochReference::EpochId doctest in src/methods/validators.rs as no_run to prevent flaky CI failures

Problem

The first doctest queries validators by a hardcoded epoch ID against a live RPC endpoint. NEAR nodes (including archival nodes) only retain ~3 epochs (~36 hours) of validator/epoch data in the EpochManager, so any hardcoded epoch ID inevitably goes stale, causing cargo test to fail with UnknownEpoch.

Fix

Changed the code fence from ``` to ```no_run so the example still compiles (ensuring correctness) but doesn't execute against a live endpoint during tests. This matches the established pattern used in other doctests throughout this repo (broadcast_tx_async.rs, broadcast_tx_commit.rs, tx.rs, send_tx.rs, experimental/protocol_config.rs).

The second doctest (EpochReference::Latest) remains runnable since it always queries the current epoch.

Copilot AI review requested due to automatic review settings February 10, 2026 02:37
@r-near r-near requested a review from a team as a code owner February 10, 2026 02:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Marks a network-dependent doctest in the validators method docs as no_run so CI doesn’t flake when a hardcoded EpochId becomes unavailable on archival RPC nodes.

Changes:

  • Updated the EpochReference::EpochId doctest fence in src/methods/validators.rs to ```no_run so it compiles but does not execute.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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