Skip to content

Fix bitreq doc example - #454

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

tcharding merged 1 commit into
rust-bitcoin:masterfrom
jamillambert:0113-bitreq-docs

Conversation

@jamillambert

Copy link
Copy Markdown
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.

@tnull tnull left a comment

Copy link
Copy Markdown
Collaborator

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

jamillambert commented Jan 14, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

tnull commented Jan 14, 2026

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator Author

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

@tcharding tcharding left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

I'm not fussed either way. Merging

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