Skip to content

Commit

Permalink
Deterministic simulation for sui tests (MystenLabs#4429)
Browse files Browse the repository at this point in the history
* Changes for starting simulator swarm

* Don't start jsonrpsee or prometheus servers in simulator

* Make start_console work when Send is required

* simulator determinism tests

* Add sui-macros crate for #[sui_test] and #[sim_test]

* Add cargo-simtest subcommand for running simulator tests

* Convert some fullnode tests to sui_test

* Add madsim deps (NOTE: fix, uses local paths)

* Disable event processing on fullnode in simulator, for determinism

* network_config_snapshot_matches cannot run in a simulator build

* Don't crash by trying to kill nodes if the runtime has shut down

* Fix hash container non-determinism

* Stop nodes when swarm is dropped

* Remove unneeded log init

* Make lock_service calls block in the simulator for determinism

* Create deterministic local addresses for nodes not built by swarm (e.g. fullnodes)

* madsim -> msim

* Replace local paths with git pointers

* Fix ordinary #[test]s in simulator

* Add github workflow

* Update deps

* Move sim-specific container stuff to separate module

* Fix lints

* Update mysten-sim dep

* Make the installed cargo-simtest script invoke the one in version control

* skip tests that don't run well in simulator

* Fix license check

* Add workspace hack deps

* Simplify config builder

* Disable unneeded simulator tests

* Update Cargo.lock

* PR comments

Co-authored-by: Mark Logan <mark@marklgn.com>
  • Loading branch information
mystenmark and mlogan authored Sep 9, 2022
1 parent bd8e0d0 commit af4ce7a
Show file tree
Hide file tree
Showing 36 changed files with 1,170 additions and 313 deletions.
1 change: 0 additions & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ xclippy = [
"-Wclippy::disallowed_methods",
]
xlint = "run --package x --bin x -- lint"

13 changes: 13 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ jobs:
- run: scripts/changed-files.sh
shell: bash

simtest:
needs: diff
if: needs.diff.outputs.isRust == 'true'
timeout-minutes: 45
runs-on: [ubuntu-ghcloud]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- uses: taiki-e/install-action@nextest
- name: cargo simtest
run: |
scripts/simtest/cargo-simtest simtest
# This is a no-op job that allows the resulting action names to line up when
# there are no rust changes in a given PR/commit. This ensures that we can
# continue to block on the rust tests passing in the case of rust changes and
Expand Down
164 changes: 145 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit af4ce7a

Please sign in to comment.