opamp-go
opamp-go copied to clipboard
Disable scheduleSend when onMessage callback is running
Resolves #88
Codecov Report
Patch coverage: 93.18% and project coverage change: +0.90 :tada:
Comparison is base (
efddaa2) 76.11% compared to head (ad3a057) 77.02%.
Additional details and impacted files
@@ Coverage Diff @@
## main #144 +/- ##
==========================================
+ Coverage 76.11% 77.02% +0.90%
==========================================
Files 24 24
Lines 1834 1893 +59
==========================================
+ Hits 1396 1458 +62
+ Misses 326 324 -2
+ Partials 112 111 -1
| Impacted Files | Coverage Δ | |
|---|---|---|
| client/types/callbacks.go | 66.66% <ø> (ø) |
|
| server/httpconnection.go | 33.33% <0.00%> (ø) |
|
| client/internal/mockserver.go | 82.35% <85.71%> (+0.31%) |
:arrow_up: |
| server/serverimpl.go | 58.92% <94.73%> (+0.37%) |
:arrow_up: |
| client/httpclient.go | 95.00% <100.00%> (+0.26%) |
:arrow_up: |
| client/internal/clientcommon.go | 79.80% <100.00%> (ø) |
|
| client/internal/httpsender.go | 72.22% <100.00%> (+1.25%) |
:arrow_up: |
| client/internal/receivedprocessor.go | 85.03% <100.00%> (+0.74%) |
:arrow_up: |
| client/internal/sender.go | 93.33% <100.00%> (+5.33%) |
:arrow_up: |
| server/callbacks.go | 68.18% <100.00%> (-4.55%) |
:arrow_down: |
| ... and 1 more |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Technically the change in this PR can be the cause of the test failure:
go test -race ./...
--- FAIL: TestUpdatePackages (5.10s)
--- FAIL: TestUpdatePackages/error_on_callback (5.03s)
--- FAIL: TestUpdatePackages/error_on_callback/ws (5.01s)
mockserver.go:250: Time out expecting a message from the client: compressed PackageStatuses
This happened because the server did not receive a message client was supposed to send. I haven't seen this error before and it is not reproducible on the latest main.
I can't see the problem by reading the code but maybe there is some race that I am not seeing that causes a ScheduleSend to missfire?
Can you try go test -run TestUpdatePackages/error_on_callback/ws -race -count 1000 on this change and see if it is possible to reproduce?
@nemoshlag, any chance you can rebase and resolve the conflicts?