Commit 09a68f9
authored
test: fix flaky test (#4218)
test: fix flaky test TestHTPasswdWatcher
See: https://github.com/project-zot/zot/actions/runs/29072040791/job/86295357131?pr=4216
```
......{"time":"2026-07-10T05:55:15.087452573Z","level":"info","message":"loaded htpasswd file","htpasswd-file":"/tmp/TestHTPasswdWatcher3310482795/011/htpasswd","users":1,"caller":"zotregistry.dev/zot/v2/pkg/api/htpasswd.go:60","func":"zotregistry.dev/zot/v2/pkg/api.(*HTPasswd).Reload","goroutine":269}
...{"time":"2026-07-10T05:55:15.806575031Z","level":"warn","message":"loaded htpasswd file appears to have zero users","htpasswd-file":"/tmp/TestHTPasswdWatcher3310482795/012/htpasswd","caller":"zotregistry.dev/zot/v2/pkg/api/htpasswd.go:58","func":"zotregistry.dev/zot/v2/pkg/api.(*HTPasswd).Reload","goroutine":269}
...{"time":"2026-07-10T05:55:16.526216362Z","level":"info","message":"loaded htpasswd file","htpasswd-file":"/tmp/TestHTPasswdWatcher3310482795/013/htpasswd","users":1,"caller":"zotregistry.dev/zot/v2/pkg/api/htpasswd.go:60","func":"zotregistry.dev/zot/v2/pkg/api.(*HTPasswd).Reload","goroutine":269}
....
Failures:
* zotregistry.dev/zot/v2/pkg/api/htpasswd_test.go
Line 352:
Expected: true
Actual: false
444 total assertions
--- FAIL: TestHTPasswdWatcher (22.64s)
```
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>1 parent bd3d363 commit 09a68f9
1 file changed
Lines changed: 16 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
| 326 | + | |
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
329 | 330 | | |
| 331 | + | |
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
| |||
344 | 346 | | |
345 | 347 | | |
346 | 348 | | |
347 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
348 | 363 | | |
349 | 364 | | |
350 | | - | |
351 | | - | |
352 | 365 | | |
353 | 366 | | |
354 | 367 | | |
| |||
0 commit comments