Skip to content

Commit

Permalink
add a small delay to prevent test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetised committed Aug 26, 2024
1 parent 5b15b51 commit bbce092
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/sync-service/test/electric/shape_cache_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,12 @@ defmodule Electric.ShapeCacheTest do

{^shape_id, ^offset} = ShapeCache.get_or_create_shape_id(@shape, opts)

# without this sleep, this test becomes unreliable. I think maybe due to
# delays in actually writing the data to cubdb/fsyncing the tx. I've
# tried explicit `CubDb.file_sync/1` calls but it doesn't work, the only
# reliable method is to wait just a little bit...
Process.sleep(5)

restart_shape_cache(context)

:started = ShapeCache.await_snapshot_start(shape_id, opts)
Expand Down

0 comments on commit bbce092

Please sign in to comment.