update tests context
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package internal_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -91,7 +90,7 @@ func TestAggregatorWriter_Write(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
aw := &internal.AggregatorWriter{}
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
for _, item := range tt.items {
|
||||
if err := aw.Write(ctx, item); err != nil {
|
||||
@@ -191,7 +190,7 @@ func TestAggregatorWriter_Rounding(t *testing.T) {
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
aw := &internal.AggregatorWriter{}
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
for _, item := range tt.items {
|
||||
if err := aw.Write(ctx, item); err != nil {
|
||||
@@ -209,7 +208,7 @@ func TestAggregatorWriter_Rounding(t *testing.T) {
|
||||
|
||||
func TestAggregatorWriter_Items(t *testing.T) {
|
||||
aw := &internal.AggregatorWriter{}
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
for range 5 {
|
||||
item := internal.ReportItem{Symbol: "TEST"}
|
||||
@@ -241,7 +240,7 @@ func TestAggregatorWriter_Items(t *testing.T) {
|
||||
|
||||
func TestAggregatorWriter_ThreadSafety(t *testing.T) {
|
||||
aw := &internal.AggregatorWriter{}
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
numGoroutines := 100
|
||||
writesPerGoroutine := 100
|
||||
|
||||
Reference in New Issue
Block a user