Skip to content

Fix bitreq doc example#454

Merged
tcharding merged 1 commit intorust-bitcoin:masterfrom
jamillambert:0113-bitreq-docs
Jan 15, 2026
Merged

Fix bitreq doc example#454
tcharding merged 1 commit intorust-bitcoin:masterfrom
jamillambert:0113-bitreq-docs

Conversation

@jamillambert
Copy link
Collaborator

The example in the docs cause a random CI failure.

Change it so that it doesn't rely on example.com anymore. Add a timeout to avoid hanging.

Closes #434

The example in the docs cause a random CI failure.

Change it so that it doesn't rely on example.com anymore. Add a timeout
to avoid hanging.
Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Hmm, rather than spawning a local HTTP server, why not just do what is done in the other examples further above and simply add a no_run flag to the beginning of the example? Seems the fix could be a +1/-1 diff here?

@jamillambert
Copy link
Collaborator Author

jamillambert commented Jan 14, 2026

Hmm, rather than spawning a local HTTP server, why not just do what is done in the other examples further above and simply add a no_run flag to the beginning of the example? Seems the fix could be a +1/-1 diff here?

Yeah I did think of that, but I just didn't like the idea of "fixing" example code that occasionally doesn't run by never running it. It's not a great example if we have to tell the compiler not to actually run it.

@tnull
Copy link
Collaborator

tnull commented Jan 14, 2026

Hmm, rather than spawning a local HTTP server, why not just do what is done in the other examples further above and simply add a no_run flag to the beginning of the example? Seems the fix could be a +1/-1 diff here?

Yeah I did think of that, but I just didn't like the idea of "fixing" example code that occasionally doesn't run by never running it. It's not a great example if we have to tell the compiler not to actually run it.

Well, the code is not broken, it just uses an unreliable endpoint. Also note that the doctest will still be compiled, so we will notice if the API changes and it gets stale somehow.

@jamillambert
Copy link
Collaborator Author

Fair point, I prefer this fix but am happy to change it to no_run if preferred.

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK 3c0c4ce

@tcharding
Copy link
Member

I'm not fussed either way. Merging

@tcharding tcharding merged commit 723faf4 into rust-bitcoin:master Jan 15, 2026
30 checks passed
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.

CI failure on bitreq docs

3 participants