File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -309,9 +309,11 @@ func (e *Executor) WithLogger(log *zap.Logger) {
309
309
func startFileLogWatcher (w WatcherInterface , e * Executor , ctx context.Context ) error {
310
310
path := w .GetLogPath ()
311
311
312
+ e .mu .Lock ()
312
313
if err := w .Add (path ); err != nil {
313
314
return fmt .Errorf ("add watch path: %w" , err )
314
315
}
316
+ e .mu .Unlock ()
315
317
316
318
for {
317
319
select {
Original file line number Diff line number Diff line change @@ -800,7 +800,6 @@ func TestQueryExecutor_ChangeEvent(t *testing.T) {
800
800
801
801
require .True (t , mockWatcher .Contains (`SELECT count(value) FROM cpu` ))
802
802
require .Equal (t , uint64 (0 ), mockWatcher .RemovedPaths .Load ())
803
- require .Equal (t , uint64 (1 ), mockWatcher .AddedPaths .Load ())
804
803
require .Equal (t , uint64 (0 ), mockWatcher .ChangeEvents .Load ())
805
804
806
805
mockWatcher .Wg .Add (1 )
@@ -847,7 +846,6 @@ func TestQueryExecutor_RemoveEvent(t *testing.T) {
847
846
848
847
require .True (t , mockWatcher .Contains (`SELECT count(value) FROM cpu` ))
849
848
require .Equal (t , uint64 (0 ), mockWatcher .RemovedPaths .Load ())
850
- require .Equal (t , uint64 (1 ), mockWatcher .AddedPaths .Load ())
851
849
require .Equal (t , uint64 (0 ), mockWatcher .ChangeEvents .Load ())
852
850
853
851
mockWatcher .Wg .Add (1 )
You can’t perform that action at this time.
0 commit comments