blocky icon indicating copy to clipboard operation
blocky copied to clipboard

Fix flaky test

Open 0xERR0R opened this issue 3 years ago • 4 comments

Sometimes we can observe following error (only with github action):

• [FAILED] [0.192 seconds]
Downloader
/home/runner/work/blocky/blocky/lists/downloader_test.go:21
  Download of a file
  /home/runner/work/blocky/blocky/lists/downloader_test.go:73
    when DNS resolution of passed URL fails
    /home/runner/work/blocky/blocky/lists/downloader_test.go:196
      [It] Should perform a retry until max retry attempt count is reached and return DNSError
      /home/runner/work/blocky/blocky/lists/downloader_test.go:203

  Expected
      <bool>: false
  to be true
  In [It] at: /home/runner/work/blocky/blocky/lists/downloader_test.go:207

0xERR0R avatar May 24 '22 12:05 0xERR0R

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 04 '22 09:08 github-actions[bot]

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 03 '22 04:11 github-actions[bot]

Got way better but I think this issue should stay open as it still gets flaky from time to time

kwitsch avatar Nov 03 '22 07:11 kwitsch

This may not be the test's problem. Instead it may be an indicator to a problem of the downloader used by blocky.

I recently switched to the following setup: (1) a script to download lists via wget (2) a static file server running locally to expose these lists to blocky. (3) blocky.

Comparing to the blocky only setup: Blocky only: total time spent on downloading and parsing is about 15 minutes. File downloading randomly failed as well.

With the local static file server: downloading: about 30 seconds. blocky parsing: about 5 minutes.

You can see that using wget not only is much faster than letting blocky download the files, but also fixes the random failures.

shizunge avatar Jul 04 '23 05:07 shizunge