wpt.fyi
wpt.fyi copied to clipboard
Add data race tests
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)