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

Add data race tests #3674

Closed
wants to merge 8 commits into from
Closed

Add data race tests #3674

wants to merge 8 commits into from

Conversation

jcscottiii
Copy link
Collaborator

@jcscottiii jcscottiii commented Jan 24, 2024

This PR is to help illustrate the data with the existing metadata cache.

=== RUN   TestDataRaceMetadataCache
==================
WARNING: DATA RACE
Read at 0x000001a0f000 by goroutine 15:
  github.com/web-platform-tests/wpt.fyi/api/query/cache/poll.TestDataRaceMetadataCache.func1()
      /usr/local/google/home/jamescscott/code/wpt.fyi/api/query/cache/poll/poll_race_test.go:37 +0xc4

Previous write at 0x000001a0f000 by goroutine 29:
  github.com/web-platform-tests/wpt.fyi/api/query/cache/poll.TestDataRaceMetadataCache.func2()
      /usr/local/google/home/jamescscott/code/wpt.fyi/api/query/cache/poll/poll_race_test.go:48 +0x96

Goroutine 15 (running) created at:
  github.com/web-platform-tests/wpt.fyi/api/query/cache/poll.TestDataRaceMetadataCache()
      /usr/local/google/home/jamescscott/code/wpt.fyi/api/query/cache/poll/poll_race_test.go:35 +0x1b8
  testing.tRunner()
      /usr/lib/google-golang/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /usr/lib/google-golang/src/testing/testing.go:1742 +0x44

Goroutine 29 (finished) created at:
  github.com/web-platform-tests/wpt.fyi/api/query/cache/poll.TestDataRaceMetadataCache()
      /usr/local/google/home/jamescscott/code/wpt.fyi/api/query/cache/poll/poll_race_test.go:45 +0x42b
  testing.tRunner()
      /usr/lib/google-golang/src/testing/testing.go:1689 +0x21e
  testing.(*T).Run.gowrap1()
      /usr/lib/google-golang/src/testing/testing.go:1742 +0x44
==================
    testing.go:1398: race detected during execution of test
--- FAIL: TestDataRaceMetadataCache (0.00s)
=== RUN   TestDataRaceWebFeaturesData
--- PASS: TestDataRaceWebFeaturesData (0.00s)

jcscottiii and others added 7 commits January 22, 2024 01:31
The service will now interpret a query that takes the form of
feature:<web-feature-key>

Similarly to the searchcacheMetadataFetcher, there is now a searchcacheWebFeaturesManifestFetcher
Co-authored-by: Kyle Ju <kyleju@google.com>
Since most of the logic has been moved into shared, I was able to
unexport a lot of things I thought I would need
Co-authored-by: Kyle Ju <kyleju@google.com>
@jcscottiii jcscottiii force-pushed the race-condition-demo branch 2 times, most recently from 6b8e11e to b6bc67b Compare January 24, 2024 17:03
Base automatically changed from jcscottiii/web-features-search-pt3 to main January 24, 2024 19:36
@KyleJu KyleJu closed this May 13, 2024
@KyleJu KyleJu deleted the race-condition-demo branch May 13, 2024 18:40
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.

None yet

2 participants