Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Conversation

@zrbecker
Copy link

This fixes the flaky oracle server test.

  • Instead of creating a listener to get a random available port, I made it so we could just use that listener directly when creating the server.
  • I added back the health check, the reason the heath check was causing issues before was that the listener was being closed as a defer call, so that make the port unavailable for the oracle server. However, using the listener directly solve this.
  • I used /version instead of /prices for health check since /prices ends up calling the mock, which we have not set mock functions for.
  • I changed the Timeout test to just check for an error instead of a specific error since the specific error it returns seems like an implementation detail of gRPC.

The test still seems a little flaky as I am getting this error after 20-30 runs

        server_test.go:215: 
                Error Trace:    /Users/zrbecker/code/skip/connect/service/servers/oracle/server_test.go:215
                Error:          Received unexpected error:
                                rpc error: code = DeadlineExceeded desc = context deadline exceeded
                Test:           TestServerTestSuite/TestOracleMarketMap

But it is certainly less flaky than it was.

@aljo242
Copy link
Contributor

aljo242 commented Sep 20, 2024

@zrbecker looks like theres some conflicts

@codecov
Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 8 lines in your changes missing coverage. Please review.

Project coverage is 57.01%. Comparing base (676a090) to head (0d8d2e9).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
service/servers/oracle/server.go 33.33% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #767      +/-   ##
==========================================
- Coverage   57.07%   57.01%   -0.07%     
==========================================
  Files         208      208              
  Lines       11625    11632       +7     
==========================================
- Hits         6635     6632       -3     
- Misses       4387     4396       +9     
- Partials      603      604       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zrbecker zrbecker changed the title [CON-1760] Fix Flaky Oracle Server Test fix: Fix Flaky Oracle Server Test Sep 20, 2024
@zrbecker
Copy link
Author

@zrbecker looks like theres some conflicts

should be resolved now

@zrbecker zrbecker merged commit 490be7a into main Sep 22, 2024
@zrbecker zrbecker deleted the zrb/fix_flaky_test branch September 22, 2024 06:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants