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

Added --properties-allowed switch and retries to test. #89

Merged
merged 11 commits into from
Dec 20, 2024

Conversation

ryanrolds
Copy link
Contributor

@ryanrolds ryanrolds commented Dec 18, 2024

This is part of reducing cardinality. The JUnit XML from Ginkgo and gotestsum contains arbitrary properties we don't want pushed to our metrics system.

  • Adds new flag that allows defining an allowed list of properties
  • Added retry package and used to improve test reliability
  • Updates junit-go to latest version

@mdelapenya
Copy link
Owner

Let's rebase and resolve conflicts first 🙏

@ryanrolds ryanrolds force-pushed the rolds/properties_allow_list branch from 0557e74 to ea12e9c Compare December 19, 2024 16:08
@ryanrolds
Copy link
Contributor Author

I've rebased and resolved conflicts. This was the branch that originally included the retry changes. Are you wanting those removed?

@mdelapenya
Copy link
Owner

I think the branch still has conflicts, probably gotten from the retry, so yeah, let's remove them by now, as they sleep was not needed anymore with the wait.ForFile strategy in the tests

main_test.go Outdated
if len(jsons) != 2 {
t.Errorf("expected 2 JSONs, got %d - %s", len(jsons), jsons)
var jsons []string
err = retry.Do(func() error {
Copy link
Owner

Choose a reason for hiding this comment

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

Let's keep the wait strategy do its job here.

@ryanrolds
Copy link
Contributor Author

ryanrolds commented Dec 20, 2024

The conflicts are from the PR that was merged after I resolved the conflicts from the earlier merge.

The test is much faster without the 30s wait. I will resolve the conflicts in the morning.

@ryanrolds
Copy link
Contributor Author

I tried it without the retry and I randomly get:

=== RUN   Test_Main_SampleXML
    main_test.go:187: could not get the collector port: port "4317/tcp" not found
2024/12/20 07:43:31 failed to upload metrics: failed to exit idle mode: dns resolver: missing port after port-separator colon
2024/12/20 07:43:31 traces export: failed to exit idle mode: dns resolver: missing port after port-separator colon
    main_test.go:236: expected 2 JSONs, got 1 - []
--- FAIL: Test_Main_SampleXML (5.62s)
panic: runtime error: index out of range [1] with length 1 [recovered]
	panic: runtime error: index out of range [1] with length 1

@ryanrolds ryanrolds requested a review from mdelapenya December 20, 2024 15:47
@ryanrolds
Copy link
Contributor Author

I've resolved the merge conflicts and am switching the port retry to use wait.

README.md Show resolved Hide resolved
Copy link
Owner

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdelapenya mdelapenya merged commit 0b0d658 into mdelapenya:main Dec 20, 2024
1 check passed
@mdelapenya mdelapenya self-assigned this Dec 20, 2024
@mdelapenya mdelapenya added the enhancement New feature or request label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants