File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
internal/component/loki/source/file/internal/tail Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 99 "time"
1010
1111 "github.com/stretchr/testify/require"
12+
13+ "github.com/grafana/alloy/internal/component/loki/source/file/internal/tail/fileext"
1214)
1315
1416func TestBlockUntilExists (t * testing.T ) {
@@ -90,6 +92,11 @@ func TestBlockUntilEvent(t *testing.T) {
9092
9193 t .Run ("should return deleted event if file is deleted" , func (t * testing.T ) {
9294 f := createEmptyFile (t , "startempty" )
95+ require .NoError (t , f .Close ())
96+
97+ // NOTE: important for windows that we open with correct flags.
98+ f , err := fileext .OpenFile (f .Name ())
99+ require .NoError (t , err )
93100 defer f .Close ()
94101
95102 go func () {
@@ -107,6 +114,11 @@ func TestBlockUntilEvent(t *testing.T) {
107114
108115 t .Run ("should return deleted event if file is deleted before" , func (t * testing.T ) {
109116 f := createEmptyFile (t , "startempty" )
117+ require .NoError (t , f .Close ())
118+
119+ // NOTE: important for windows that we open with correct flags.
120+ f , err := fileext .OpenFile (f .Name ())
121+ require .NoError (t , err )
110122 defer f .Close ()
111123
112124 removeFile (t , f .Name ())
You can’t perform that action at this time.
0 commit comments