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

Update delete integration test #6192

Merged
merged 13 commits into from
Jun 7, 2022

Conversation

MichelHollands
Copy link
Contributor

@MichelHollands MichelHollands commented May 18, 2022

What this PR does / why we need it:

Update the deletion integration test so it waits until the delete request has been processed. Note that at the moment no lines are removed due to flush not working. This will be fixed later on in a separate PR.
Add a metric to show how many lines are deleted.
Remove mention of Cortex in a helper function.
Change the various timeouts so the test runs in 10 seconds.
Add code to parse and check metrics.

Checklist

  • Documentation added
  • Tests updated
  • Is this an important fix or new feature? Add an entry in the CHANGELOG.md.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/upgrading/_index.md

Signed-off-by: Michel Hollands <[email protected]>
Signed-off-by: Michel Hollands <[email protected]>
@pull-request-size pull-request-size bot added size/L and removed size/M labels May 19, 2022
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

@MichelHollands MichelHollands marked this pull request as ready for review May 20, 2022 11:06
@MichelHollands MichelHollands requested a review from a team as a code owner May 20, 2022 11:06
Copy link
Contributor

@MasslessParticle MasslessParticle left a comment

Choose a reason for hiding this comment

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

This looks awesome

integration/loki_micro_services_delete_test.go Outdated Show resolved Hide resolved
Signed-off-by: Michel Hollands <[email protected]>
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0.3%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

Copy link
Collaborator

@trevorwhitney trevorwhitney left a comment

Choose a reason for hiding this comment

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

This looks great! LGTM

integration/loki_micro_services_delete_test.go Outdated Show resolved Hide resolved
@grafanabot
Copy link
Collaborator

./tools/diff_coverage.sh ../loki-main/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki

Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell.

+           ingester	0%
+        distributor	0.3%
+            querier	0%
+ querier/queryrange	0%
+               iter	0%
+            storage	0%
+           chunkenc	0%
+              logql	0%
+               loki	0%

Comment on lines +304 to +305
newErr := fmt.Errorf("error starting component %v: %w", c.name, err)
errCh <- newErr
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: since newErr is used nowhere else ...

Suggested change
newErr := fmt.Errorf("error starting component %v: %w", c.name, err)
errCh <- newErr
errCh <- fmt.Errorf("error starting component %v: %w", c.name, err)

@owen-d owen-d merged commit 65e3148 into grafana:main Jun 7, 2022
@grafanabot
Copy link
Collaborator

The backport to k102 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-6192-to-k102 origin/k102
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 65e3148bc97159a2efaefdc0bcc5e2fa88c40870
# Push it to GitHub
git push --set-upstream origin backport-6192-to-k102
git switch main
# Remove the local backport branch
git branch -D backport-6192-to-k102

Then, create a pull request where the base branch is k102 and the compare/head branch is backport-6192-to-k102.

MichelHollands added a commit to MichelHollands/loki that referenced this pull request Jun 23, 2022
* Add wait until processed

Signed-off-by: Michel Hollands <[email protected]>

* Add query lines

Signed-off-by: Michel Hollands <[email protected]>

* Remove Cortex reference

Signed-off-by: Michel Hollands <[email protected]>

* Add deleted lines metric and check in test

Signed-off-by: Michel Hollands <[email protected]>

* Set negative cancel period so default 1 minute delay is compensated for

Signed-off-by: Michel Hollands <[email protected]>

* Reduce timeout

Signed-off-by: Michel Hollands <[email protected]>

* Add helper function

Signed-off-by: Michel Hollands <[email protected]>

* Comment out assertions that only work with flush

Signed-off-by: Michel Hollands <[email protected]>

* Remove unused metric type param

Signed-off-by: Michel Hollands <[email protected]>

* Check counter in unit test

Signed-off-by: Michel Hollands <[email protected]>

* Rename ClientOption to Option as per the linter

Signed-off-by: Michel Hollands <[email protected]>

* Remove redundant check

Signed-off-by: Michel Hollands <[email protected]>

* fill in MsgAndArgs field of test assertion

Signed-off-by: Michel Hollands <[email protected]>
(cherry picked from commit 65e3148)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants