@@ -33,7 +33,7 @@ func TestRealWaiterWaitMissingFile(t *testing.T) {
3333 // Create a temp file and then immediately delete it to get
3434 // a legitimate tmp path and ensure the file doesnt exist
3535 // prior to testing Wait().
36- tmp , err := os .CreateTemp ("" , "real_waiter_test_file" )
36+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file" )
3737 if err != nil {
3838 t .Errorf ("error creating temp file: %v" , err )
3939 }
@@ -61,7 +61,7 @@ func TestRealWaiterWaitMissingFile(t *testing.T) {
6161}
6262
6363func TestRealWaiterWaitWithFile (t * testing.T ) {
64- tmp , err := os .CreateTemp ("" , "real_waiter_test_file" )
64+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file" )
6565 if err != nil {
6666 t .Errorf ("error creating temp file: %v" , err )
6767 }
@@ -85,7 +85,7 @@ func TestRealWaiterWaitWithFile(t *testing.T) {
8585}
8686
8787func TestRealWaiterWaitMissingContent (t * testing.T ) {
88- tmp , err := os .CreateTemp ("" , "real_waiter_test_file" )
88+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file" )
8989 if err != nil {
9090 t .Errorf ("error creating temp file: %v" , err )
9191 }
@@ -112,7 +112,7 @@ func TestRealWaiterWaitMissingContent(t *testing.T) {
112112}
113113
114114func TestRealWaiterWaitWithContent (t * testing.T ) {
115- tmp , err := os .CreateTemp ("" , "real_waiter_test_file" )
115+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file" )
116116 if err != nil {
117117 t .Errorf ("error creating temp file: %v" , err )
118118 }
@@ -126,7 +126,7 @@ func TestRealWaiterWaitWithContent(t *testing.T) {
126126 }
127127 close (doneCh )
128128 }()
129- if err := os .WriteFile (tmp .Name (), []byte ("😺" ), 0700 ); err != nil {
129+ if err := os .WriteFile (tmp .Name (), []byte ("😺" ), 0o700 ); err != nil {
130130 t .Errorf ("error writing content to temp file: %v" , err )
131131 }
132132 delay := time .NewTimer (2 * testWaitPollingInterval )
@@ -139,7 +139,7 @@ func TestRealWaiterWaitWithContent(t *testing.T) {
139139}
140140
141141func TestRealWaiterWaitWithErrorWaitfile (t * testing.T ) {
142- tmp , err := os .CreateTemp ("" , "real_waiter_test_file*.err" )
142+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file*.err" )
143143 if err != nil {
144144 t .Errorf ("error creating temp file: %v" , err )
145145 }
@@ -170,7 +170,7 @@ func TestRealWaiterWaitWithErrorWaitfile(t *testing.T) {
170170}
171171
172172func TestRealWaiterWaitWithBreakpointOnFailure (t * testing.T ) {
173- tmp , err := os .CreateTemp ("" , "real_waiter_test_file*.err" )
173+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file*.err" )
174174 if err != nil {
175175 t .Errorf ("error creating temp file: %v" , err )
176176 }
@@ -196,7 +196,7 @@ func TestRealWaiterWaitWithBreakpointOnFailure(t *testing.T) {
196196}
197197
198198func TestRealWaiterWaitWithContextCanceled (t * testing.T ) {
199- tmp , err := os .CreateTemp ("" , "real_waiter_test_file" )
199+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file" )
200200 if err != nil {
201201 t .Errorf ("error creating temp file: %v" , err )
202202 }
@@ -224,7 +224,7 @@ func TestRealWaiterWaitWithContextCanceled(t *testing.T) {
224224}
225225
226226func TestRealWaiterWaitWithTimeout (t * testing.T ) {
227- tmp , err := os .CreateTemp ("" , "real_waiter_test_file" )
227+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file" )
228228 if err != nil {
229229 t .Errorf ("error creating temp file: %v" , err )
230230 }
@@ -252,7 +252,7 @@ func TestRealWaiterWaitWithTimeout(t *testing.T) {
252252}
253253
254254func TestRealWaiterWaitContextWithBreakpointOnFailure (t * testing.T ) {
255- tmp , err := os .CreateTemp ("" , "real_waiter_test_file*.err" )
255+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file*.err" )
256256 if err != nil {
257257 t .Errorf ("error creating temp file: %v" , err )
258258 }
@@ -278,7 +278,7 @@ func TestRealWaiterWaitContextWithBreakpointOnFailure(t *testing.T) {
278278}
279279
280280func TestRealWaiterWaitContextWithErrorWaitfile (t * testing.T ) {
281- tmp , err := os .CreateTemp ("" , "real_waiter_test_file*.err" )
281+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file*.err" )
282282 if err != nil {
283283 t .Errorf ("error creating temp file: %v" , err )
284284 }
@@ -309,7 +309,7 @@ func TestRealWaiterWaitContextWithErrorWaitfile(t *testing.T) {
309309}
310310
311311func TestRealWaiterWaitContextWithContent (t * testing.T ) {
312- tmp , err := os .CreateTemp ("" , "real_waiter_test_file" )
312+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file" )
313313 if err != nil {
314314 t .Errorf ("error creating temp file: %v" , err )
315315 }
@@ -323,7 +323,7 @@ func TestRealWaiterWaitContextWithContent(t *testing.T) {
323323 }
324324 close (doneCh )
325325 }()
326- if err := os .WriteFile (tmp .Name (), []byte ("😺" ), 0700 ); err != nil {
326+ if err := os .WriteFile (tmp .Name (), []byte ("😺" ), 0o700 ); err != nil {
327327 t .Errorf ("error writing content to temp file: %v" , err )
328328 }
329329 delay := time .NewTimer (2 * testWaitPollingInterval )
@@ -339,7 +339,7 @@ func TestRealWaiterWaitContextMissingFile(t *testing.T) {
339339 // Create a temp file and then immediately delete it to get
340340 // a legitimate tmp path and ensure the file doesnt exist
341341 // prior to testing Wait().
342- tmp , err := os .CreateTemp ("" , "real_waiter_test_file" )
342+ tmp , err := os .CreateTemp (t . TempDir () , "real_waiter_test_file" )
343343 if err != nil {
344344 t .Errorf ("error creating temp file: %v" , err )
345345 }
0 commit comments