Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Fix errors from local testnet scripts on MacOS #2919

Closed
wants to merge 10 commits into from

Conversation

ackintosh
Copy link
Member

@ackintosh ackintosh commented Jan 16, 2022

Issue Addressed

Resolves #2763

Proposed Changes

  • Add a workflow which tests that local testnet starts successfully
    • Added set option into the scripts in order to fail fast so that we can notice errors during starting local testnet.
  • Fix errors on MacOS
    • The redirect &>> is supported since bash v4 but the version bundled in macOS(11.6.1) is v3. a54f119

@ackintosh ackintosh changed the title [WIP] Local testnet [WIP] Fix errors from local testnet scripts on MacOS Jan 16, 2022
… MacOS

"&>>" is supported since bash v4 but the bash version bundled in macOS(11.6.1) is v3.
@ackintosh ackintosh changed the title [WIP] Fix errors from local testnet scripts on MacOS Fix errors from local testnet scripts on MacOS Jan 17, 2022
@ackintosh
Copy link
Member Author

ackintosh commented Jan 18, 2022

The error occured in setup.sh.

https://github.com/sigp/lighthouse/runs/4854687564?check_suite_focus=true

./setup.sh >> /Users/runner/.lighthouse/local-testnet/testnet/setup.log 2>&1
Failed to run lcli: Failed to run deploy-deposit-contract command: Failed to deploy deposit contract: "Failed to deploy contract: Failed to get accounts: Transport("failed to send request: error sending request for url (http://localhost:8545/): error trying to connect: tcp connect error: Connection refused (os error 61)"). Is scripts/ganache_tests_node.sh running?."

This is due to call lcli deploy-deposit-contract before ganache-cli has started listening. Also, this could occurs on Linux.

The ideal solution is to wait until the port (http://localhost:8545) is available, but this is a bit of a pain. A simple solution is to extend the sleep time.

It is in order to ensure that ganache has started to listening for requests.
sigp#2919 (comment)
@ackintosh ackintosh marked this pull request as ready for review January 18, 2022 22:30
@ackintosh
Copy link
Member Author

This PR is ready for review. 🙆‍♂️

@michaelsproul michaelsproul added the ready-for-review The code is ready for review label Jan 18, 2022
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you! 🙏

@paulhauner paulhauner added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Jan 25, 2022
@paulhauner
Copy link
Member

bors r+

1 similar comment
@paulhauner
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jan 26, 2022
## Issue Addressed

Resolves #2763

## Proposed Changes

- Add a workflow which tests that local testnet starts successfully
  - Added `set` option into the scripts in order to fail fast so that we can notice errors during starting local testnet.
- Fix errors on MacOS
  - The redirect `&>>` is supported since bash v4 but the version bundled in macOS(11.6.1) is v3. a54f119
@bors bors bot changed the title Fix errors from local testnet scripts on MacOS [Merged by Bors] - Fix errors from local testnet scripts on MacOS Jan 27, 2022
@bors bors bot closed this Jan 27, 2022
@ackintosh ackintosh deleted the local-testnet branch January 27, 2022 06:15
@michaelsproul
Copy link
Member

A few of the local-testnet CI runs seem to be failing on macOS: https://github.com/sigp/lighthouse/runs/4962371601?check_suite_focus=true

I'm not sure what's causing it yet

@ackintosh
Copy link
Member Author

Hmm... I think, to consider from the log below,

https://github.com/sigp/lighthouse/runs/4962371601?check_suite_focus=true#step:7:52

= ============================================================================
/Users/runner/.lighthouse/local-testnet/testnet/setup.log
= ============================================================================
Submitting deposit for validator 69...
Submitting deposit for validator 70...
Submitting deposit for validator 71...
Submitting deposit for validator 72...
Submitting deposit for validator 73...
Submitting deposit for validator 74...
Submitting deposit for validator 75...
Submitting deposit for validator 76...
Submitting deposit for validator 77...
Submitting deposit for validator 78...

https://github.com/sigp/lighthouse/runs/4962371601?check_suite_focus=true#step:7:29

= ============================================================================
/Users/runner/.lighthouse/local-testnet/testnet/bootnode.log
= ============================================================================
./bootnode.sh >> /Users/runner/.lighthouse/local-testnet/testnet/bootnode.log 2>&1
Generating bootnode enr
Generated bootnode enr and written to /Users/runner/.lighthouse/local-testnet/testnet/boot_enr.yaml
Starting bootnode
Unable to open testnet dir at "/Users/runner/.lighthouse/local-testnet/testnet": Unable to open deploy_block.txt: Os { code: 2, kind: NotFound, message: "No such file or directory" }

https://github.com/sigp/lighthouse/runs/4962371601?check_suite_focus=true#step:7:66

= ============================================================================
/Users/runner/.lighthouse/local-testnet/testnet/validator_node_1.log
= ============================================================================
./validator_client.sh /Users/runner/.lighthouse/local-testnet/node_1 http://localhost:8001 info >> /Users/runner/.lighthouse/local-testnet/testnet/validator_node_1.log 2>&1
Unable to open testnet dir at "/Users/runner/.lighthouse/local-testnet/testnet": Unable to open deploy_block.txt: Os { code: 2, kind: NotFound, message: "No such file or directory" }

this is due to calling boot_node.sh , validator_client.sh before setup.sh has completed. 🤔

@ackintosh
Copy link
Member Author

I believe executing setup.sh foreground instead of background would be a solution. I will file a PR soon.

bors bot pushed a commit that referenced this pull request Jan 31, 2022
## Issue Addressed

Resolves #2919 (comment)

## Proposed Changes

- Run setup.sh foreground in order to avoid timing issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants