Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use telemetry in standalone mode with ZEEKCTL_DISABLE_LISTEN, plus a bunch of cleanups #79

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ckreibich
Copy link
Member

I've not been able to definitively show how the port collision in #72 arises, but since this is not one of the tests that btest serializes (no @TEST-SERIALIZE: listen), I'm pretty sure that's the culprit. My fix here is not to just serialize the test, but to make the use of telemetry in standalone mode depend on our use of ZEEKCTL_DISABLE_LISTEN, which was previously missing. I suspect this also fixes #75, but we'll have to see.

I'm also adding an explanation of how these tests work to the README, and I'm dusting off some stuff that lets us regenerate the docs.

The way these tests separate their install tree from the test folders makes them pretty suboptimal for use in CI. For now I don't see a need to invest lots of time here, but the cluster testsuite would be a better place for all of this. I'm adding a btest environment debug so they're not auto-cleaned.

@ckreibich ckreibich force-pushed the topic/christian/fix-unreliable-tests branch 2 times, most recently from b5696b5 to 203a786 Compare February 21, 2025 22:20
@ckreibich ckreibich changed the title Don't use telemetry in standalone mode, plus a bunch of cleanups Don't use telemetry in standalone mode with ZEEKCTL_DISABLE_LISTEN, plus a bunch of cleanups Feb 21, 2025
ckreibich added a commit to zeek/zeek that referenced this pull request Feb 21, 2025
ckreibich added a commit to zeek/zeek that referenced this pull request Feb 21, 2025
…ISTEN

This could cause transient port availability problems, and thus test failures,
since while Broker didn't end up listening in those scenarios, Zeek opened up
the Prometheus port regardless.

I was tempted to guard the whole thing via the env var, but in case something
verifies ports it seems safer to focus the guard on the telemetry port.

Resolves #72
When we added this I changed the docstring for this in the generated sources
since I had no idea zeekctl has automated docs extraction. Gnnn.
@ckreibich ckreibich force-pushed the topic/christian/fix-unreliable-tests branch from 203a786 to a2e6697 Compare February 21, 2025 22:57
ckreibich added a commit to zeek/zeek that referenced this pull request Feb 21, 2025
@@ -178,7 +178,10 @@ def use_port(self, node):
# This is the port that standalone nodes listen on for remote
# control by default.
ostr += f"redef Broker::default_port = {zeekport.use_port(manager)}/tcp;\n"
ostr += '@if ( getenv("ZEEKCTL_DISABLE_LISTEN") == "" )\n'
Copy link
Contributor

Choose a reason for hiding this comment

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

We have the following over in telemetry/Manager.cc

https://github.com/zeek/zeek/blob/6671e95c6b07dfd59a12ec5507a5c3eb91f163ef/src/telemetry/Manager.cc#L90

But, I think this is better here as you have it., maybe redef to 0/tcp to explicitly disable in the else path? No strong opinion.

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.

Test command.netstats is flaky
2 participants