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: Finish sync work for mockIngester.pushed var #12028

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

paul1r
Copy link
Contributor

@paul1r paul1r commented Feb 21, 2024

What this PR does / why we need it:

Before this PR:


==================
WARNING: DATA RACE
Read at 0x00c000b44348 by goroutine 330:
  github.com/grafana/loki/pkg/distributor.Test_IncrementTimestamp.func1()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor_test.go:399 +0x170
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1595 +0x1b0
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c000b44348 by goroutine 372:
  github.com/grafana/loki/pkg/distributor.(*mockIngester).Push()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor_test.go:1230 +0x184
  github.com/grafana/loki/pkg/distributor.(*Distributor).sendStreamsErr()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:673 +0x27c
  github.com/grafana/loki/pkg/distributor.(*Distributor).sendStreams()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:629 +0xd8
  github.com/grafana/loki/pkg/distributor.(*Distributor).Push.func3()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:477 +0x1c0
  github.com/grafana/loki/pkg/distributor.(*Distributor).Push.func4()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:478 +0xe8

Goroutine 330 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x5e8
  github.com/grafana/loki/pkg/distributor.Test_IncrementTimestamp()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor_test.go:394 +0x31f0
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1595 +0x1b0
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x40

Goroutine 372 (finished) created at:
  github.com/grafana/loki/pkg/distributor.(*Distributor).Push()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:469 +0x92c
  github.com/grafana/loki/pkg/distributor.Test_IncrementTimestamp.func1()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor_test.go:397 +0x140
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1595 +0x1b0
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x40
==================
--- FAIL: Test_IncrementTimestamp (1.01s)
    --- FAIL: Test_IncrementTimestamp/incrementing_disabled,_no_dupes (0.11s)
        testing.go:1465: race detected during execution of test
    testing.go:1465: race detected during execution of test
==================
WARNING: DATA RACE
Write at 0x00c001137de8 by goroutine 906:
  github.com/grafana/loki/pkg/distributor.(*mockIngester).Push()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor_test.go:1230 +0x184
  github.com/grafana/loki/pkg/distributor.(*Distributor).sendStreamsErr()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:673 +0x27c
  github.com/grafana/loki/pkg/distributor.(*Distributor).sendStreams()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:629 +0xd8
  github.com/grafana/loki/pkg/distributor.(*Distributor).Push.func3()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:477 +0x1c0
  github.com/grafana/loki/pkg/distributor.(*Distributor).Push.func4()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:478 +0xe8

Previous read at 0x00c001137de8 by goroutine 865:
  github.com/grafana/loki/pkg/distributor.Test_SortLabelsOnPush()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor_test.go:503 +0x27c
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1595 +0x1b0
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x40

Goroutine 906 (running) created at:
  github.com/grafana/loki/pkg/distributor.(*Distributor).Push()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:469 +0x92c
  github.com/grafana/loki/pkg/distributor.Test_SortLabelsOnPush()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor_test.go:501 +0x24c
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1595 +0x1b0
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x40

Goroutine 865 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x5e8
  testing.runTests.func1()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:2054 +0x80
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1595 +0x1b0
  testing.runTests()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:2052 +0x6e4
  testing.(*M).Run()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1925 +0x9ec
  main.main()
      _testmain.go:97 +0x294
==================
--- FAIL: Test_SortLabelsOnPush (0.12s)
    testing.go:1465: race detected during execution of test
==================
WARNING: DATA RACE
Read at 0x00c0004e5de8 by goroutine 910:
  github.com/grafana/loki/pkg/distributor.Test_TruncateLogLines.func2()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor_test.go:522 +0x174
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1595 +0x1b0
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x40

Previous write at 0x00c0004e5de8 by goroutine 950:
  github.com/grafana/loki/pkg/distributor.(*mockIngester).Push()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor_test.go:1230 +0x184
  github.com/grafana/loki/pkg/distributor.(*Distributor).sendStreamsErr()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:673 +0x27c
  github.com/grafana/loki/pkg/distributor.(*Distributor).sendStreams()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:629 +0xd8
  github.com/grafana/loki/pkg/distributor.(*Distributor).Push.func3()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:477 +0x1c0
  github.com/grafana/loki/pkg/distributor.(*Distributor).Push.func4()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:478 +0xe8

Goroutine 910 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x5e8
  github.com/grafana/loki/pkg/distributor.Test_TruncateLogLines()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor_test.go:516 +0x90
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1595 +0x1b0
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x40

Goroutine 950 (finished) created at:
  github.com/grafana/loki/pkg/distributor.(*Distributor).Push()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor.go:469 +0x92c
  github.com/grafana/loki/pkg/distributor.Test_TruncateLogLines.func2()
      /Users/progers/dev/src/github.com/grafana/loki/pkg/distributor/distributor_test.go:520 +0x140
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1595 +0x1b0
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.21.6/libexec/src/testing/testing.go:1648 +0x40
==================
--- FAIL: Test_TruncateLogLines (0.11s)
    --- FAIL: Test_TruncateLogLines/it_truncates_lines_to_MaxLineSize_when_MaxLineSizeTruncate_is_true (0.11s)
        testing.go:1465: race detected during execution of test
    testing.go:1465: race detected during execution of test
FAIL
FAIL	github.com/grafana/loki/pkg/distributor	4.555s

After:

progers@Pauls-MacBook-Pro distributor % go test . -race -count=1
ok  	github.com/grafana/loki/pkg/distributor	5.432s

Which issue(s) this PR fixes:
Relates to: #8586

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
    • If the change is worth mentioning in the release notes, add add-to-release-notes label
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@paul1r paul1r requested a review from a team as a code owner February 21, 2024 22:05
@paul1r paul1r changed the title Finish sync work for mockIngester.pushed var Test: Finish sync work for mockIngester.pushed var Feb 21, 2024
@paul1r paul1r changed the title Test: Finish sync work for mockIngester.pushed var test: Finish sync work for mockIngester.pushed var Feb 21, 2024
@paul1r paul1r merged commit edc9a44 into main Feb 21, 2024
13 checks passed
@paul1r paul1r deleted the paul1r/distributor_test_sync_pushed_var branch February 21, 2024 22:31
onelapahead pushed a commit to onelapahead/loki that referenced this pull request Feb 22, 2024
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
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.

None yet

2 participants