Skip to content

Commit

Permalink
Fix race condition in TestTextSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov authored and na-- committed Mar 1, 2021
1 parent 5bcf37f commit 1bfb68b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/summary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const (
func TestTextSummary(t *testing.T) {
t.Parallel()

summary := createTestSummary(t)
testCases := []struct {
stats []string
expected string
Expand All @@ -70,6 +69,7 @@ func TestTextSummary(t *testing.T) {
i, tc := i, tc
t.Run(fmt.Sprintf("%d_%v", i, tc.stats), func(t *testing.T) {
t.Parallel()
summary := createTestSummary(t)
trendStats, err := json.Marshal(tc.stats)
require.NoError(t, err)
runner, err := getSimpleRunner(
Expand All @@ -88,9 +88,9 @@ func TestTextSummary(t *testing.T) {
require.Len(t, result, 1)
stdout := result["stdout"]
require.NotNil(t, stdout)
summary, err := ioutil.ReadAll(stdout)
summaryOut, err := ioutil.ReadAll(stdout)
require.NoError(t, err)
assert.Equal(t, "\n"+tc.expected+"\n", string(summary))
assert.Equal(t, "\n"+tc.expected+"\n", string(summaryOut))
})
}
}
Expand Down

0 comments on commit 1bfb68b

Please sign in to comment.