From 637880d95f8085b36fe44a18e71563c5493d6584 Mon Sep 17 00:00:00 2001 From: Hein Meling Date: Sat, 9 Mar 2024 21:57:00 +0100 Subject: [PATCH 1/2] fix: sleep a bit to let the eventloop start before adding events This fixes flakiness with the eventloop's TestHandler. See issue #120. --- eventloop/eventloop_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eventloop/eventloop_test.go b/eventloop/eventloop_test.go index 199b54f5..c322f10d 100644 --- a/eventloop/eventloop_test.go +++ b/eventloop/eventloop_test.go @@ -22,6 +22,9 @@ func TestHandler(t *testing.T) { defer cancel() go el.Run(ctx) + // wait for the event loop to start + time.Sleep(1 * time.Millisecond) + want := testEvent(42) el.AddEvent(want) From 8685fd92bd7f0a2227b2c74ae90684949e942ece Mon Sep 17 00:00:00 2001 From: Hein Meling Date: Sat, 9 Mar 2024 22:16:28 +0100 Subject: [PATCH 2/2] feat: add codecov.yml to allow 1% wiggle room in coverage --- .github/codecov.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 00000000..7e6c6e20 --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,6 @@ +coverage: + status: + project: + default: + target: auto + threshold: 1%