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

test(metrics): Less flaky graceful shutdown #1203

Closed
wants to merge 2 commits into from

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Mar 4, 2022

test_graceful_shutdown failed in ~50% of runs. With this change, it passes 100 subsequent runs, at least on local machine.

#skip-changelog

@jjbayer jjbayer marked this pull request as ready for review March 4, 2022 14:55
@jjbayer jjbayer requested a review from a team March 4, 2022 14:55
@@ -572,18 +572,23 @@ def test_graceful_shutdown(mini_sentry, relay):
metrics_payload = f"bar:17|c"
future_timestamp = timestamp + 60
relay.send_metrics(project_id, metrics_payload, future_timestamp)

sleep(1) # Give Relay some time to fetch project config
Copy link
Member

@untitaker untitaker Mar 4, 2022

Choose a reason for hiding this comment

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

My problem is that in that time, Relay may already have flushed out the metrics, making this test less meaningful as then there's nothing to do in shutdown. We may want to bump the flush interval (not sure which setting that is)

Copy link
Member Author

Choose a reason for hiding this comment

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

The "bar" metric would only be flushed after initial_delay (that was 10 seconds, have now bumped it to 100 seconds).

Copy link
Member

Choose a reason for hiding this comment

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

I'm starting to suspect that the actual problem here is in Relay rather than the tests and is the same cause as the dropped buckets we observe on shutdown. Relay immediately flushes the buckets when it receives the shutdown signal and drops the buckets if project states are not yet fetched (or outdated). Instead, it should try to fetch the states during the grace period, still.

@jjbayer
Copy link
Member Author

jjbayer commented Mar 7, 2022

Closing this in favor of #1205.

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.

3 participants