8000 GitHub - elixir-toniq/schism: Partition testing tool for elixir
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

elixir-toniq/schism

{"props":{"initialPayload":{"allShortcutsEnabled":false,"path":"/","repo":{"id":171137475,"defaultBranch":"master","name":"schism","ownerLogin":"elixir-toniq","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2019-02-17T15:23:06.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/32466685?v=4","public":true,"private":false,"isOrgOwned":true},"currentUser":null,"refInfo":{"name":"master","listCacheKey":"v0:1680174078.40021","canEdit":false,"refType":"branch","currentOid":"dd967ee84e56494d58c6b3d126bdc3a553e15227"},"tree":{"items":[{"name":".github","path":".github","contentType":"directory"},{"name":"config","path":"config","contentType":"directory"},{"name":"lib","path":"lib","contentType":"directory"},{"name":"test","path":"test","contentType":"directory"},{"name":".formatter.exs","path":".formatter.exs","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"mix.exs","path":"mix.exs","contentType":"file"},{"name":"mix.lock","path":"mix.lock","contentType":"file"}],"templateDirectorySuggestionUrl":null,"readme":null,"totalCount":10,"showBranchInfobar":false},"fileTree":null,"fileTreeProcessingTime":null,"foldersToFetch":[],"treeExpanded":false,"symbolsExpanded":false,"isOverview":true,"overview":{"banners":{"shouldRecommendReadme":false,"isPersonalRepo":false,"showUseActionBanner":false,"actionSlug":null,"actionId":null,"showProtectBranchBanner":false,"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_repo","releasePath":"/elixir-toniq/schism/releases/new?marketplace=true","showPublishActionBanner":false},"interactionLimitBanner":null,"showInvitationBanner":false,"inviterName":null,"actionsMigrationBannerInfo":{"releaseTags":[],"showImmutableActionsMigrationBanner":false,"initialMigrationStatus":null}},"codeButton":{"contactPath":"/contact","isEnterprise":false,"local":{"protocolInfo":{"httpAvailable":true,"sshAvailable":null,"httpUrl":"https://github.com/elixir-toniq/schism.git","showCloneWarning":null,"sshUrl":null,"sshCertificatesRequired":null,"sshCertificatesAvailable":null,"ghCliUrl":"gh repo clone elixir-toniq/schism","defaultProtocol":"http","newSshKeyUrl":"/settings/ssh/new","setProtocolPath":"/users/set_protocol"},"platformInfo":{"cloneUrl":"https://desktop.github.com","showVisualStudioCloneButton":false,"visualStudioCloneUrl":"https://windows.github.com","showXcodeCloneButton":false,"xcodeCloneUrl":"xcode://clone?repo=https%3A%2F%2Fgithub.com%2Felixir-toniq%2Fschism","zipballUrl":"/elixir-toniq/schism/archive/refs/heads/master.zip"}},"newCodespacePath":"/codespaces/new?hide_repo_select=true\u0026repo=171137475"},"popovers":{"rename":null,"renamedParentRepo":null},"commitCount":"56","overviewFiles":[{"displayName":"README.md","repoName":"schism","refName":"master","path":"README.md","preferredFileType":"readme","tabName":"README","richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSchism\u003c/h1\u003e\u003ca id=\"user-content-schism\" class=\"anchor\" aria-label=\"Permalink: Schism\" href=\"#schism\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://circleci.com/gh/keathley/schism\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/7669eaf697736a738afbfd55eb75425fecd7547acbf06710e9b5bce777a32497/68747470733a2f2f636972636c6563692e636f6d2f67682f6b656174686c65792f73636869736d2e7376673f7374796c653d737667\" alt=\"CircleCI\" data-canonical-src=\"https://circleci.com/gh/keathley/schism.svg?style=svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003ca href=\"https://hexdocs.pm/schism/\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/c21574baf34c81b3651a5274c8b074471bc1e142a9516c0cfa75dea9223d93fe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63732d6c61746573742d626c75652e737667\" alt=\"Documentation\" data-canonical-src=\"https://img.shields.io/badge/docs-latest-blue.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eSchism provides a simple api for testing partitions between BEAM nodes.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eDocumentation: \u003ca href=\"https://hexdocs.pm/schism\" rel=\"nofollow\"\u003ehttps://hexdocs.pm/schism\u003c/a\u003e.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eInstallation\u003c/h2\u003e\u003ca id=\"user-content-installation\" class=\"anchor\" aria-label=\"Permalink: Installation\" href=\"#installation\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eIf \u003ca href=\"https://hex.pm/docs/publish\" rel=\"nofollow\"\u003eavailable in Hex\u003c/a\u003e, the package can be installed\nby adding \u003ccode\u003eschism\u003c/code\u003e to your list of dependencies in \u003ccode\u003emix.exs\u003c/code\u003e:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-elixir notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"def deps do\n [\n {:schism, \u0026quot;~\u0026gt; 1.0\u0026quot;, only: [:dev, :test]}\n ]\nend\"\u003e\u003cpre\u003e\u003cspan class=\"pl-k\"\u003edef\u003c/span\u003e \u003cspan class=\"pl-en\"\u003edeps\u003c/span\u003e \u003cspan class=\"pl-k\"\u003edo\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e{\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e:schism\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\"~\u0026gt; 1.0\"\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-pds\"\u003eonly: \u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-pds\"\u003e:dev\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-pds\"\u003e:test\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e}\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eend\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUsage\u003c/h2\u003e\u003ca id=\"user-content-usage\" class=\"anchor\" aria-label=\"Permalink: Usage\" href=\"#usage\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eLet's say that we have 5 nodes and we want to test what happens when they\ndisconnect from each other. We can use schism like so:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-elixir notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"test \u0026quot;netsplits\u0026quot; do\n [n1, n2, n3, n4, n5] = nodes\n\n # Partition our nodes\n Schism.partition([n1, n3])\n Schism.partition([n4])\n Schism.partition([n2, n5])\n\n # Test some stuff...\n\n # Heal our partitions\n Schism.heal([n1, n3])\n Schism.heal([n2, n4, n5])\nend\"\u003e\u003cpre\u003e\u003cspan class=\"pl-en\"\u003etest\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\"netsplits\"\u003c/span\u003e \u003cspan class=\"pl-k\"\u003edo\u003c/span\u003e\n \u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003en1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003en2\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003en3\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003en4\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003en5\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003enodes\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e# Partition our nodes\u003c/span\u003e\n \u003cspan class=\"pl-v\"\u003eSchism\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003epartition\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003en1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003en3\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-v\"\u003eSchism\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003epartition\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003en4\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-v\"\u003eSchism\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003epartition\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003en2\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003en5\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e# Test some stuff...\u003c/span\u003e\n\n \u003cspan class=\"pl-c\"\u003e# Heal our partitions\u003c/span\u003e\n \u003cspan class=\"pl-v\"\u003eSchism\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eheal\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003en1\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003en3\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n \u003cspan class=\"pl-v\"\u003eSchism\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e.\u003c/span\u003e\u003cspan class=\"pl-en\"\u003eheal\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e(\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e[\u003c/span\u003e\u003cspan class=\"pl-s1\"\u003en2\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003en4\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e,\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003en5\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e]\u003c/span\u003e\u003cspan class=\"pl-kos\"\u003e)\u003c/span\u003e\n\u003cspan class=\"pl-k\"\u003eend\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis api is useful for testing and development in conjunction with tools like\n\u003ca href=\"https://github.com/whitfin/local-cluster\"\u003elocal cluster\u003c/a\u003e and \u003ca href=\"https://github.com/alfert/propcheck\"\u003epropcheck\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eIt is not recommended that you use this in production.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eThings Schism doesn't do\u003c/h2\u003e\u003ca id=\"user-content-things-schism-doesnt-do\" class=\"anchor\" aria-label=\"Permalink: Things Schism doesn't do\" href=\"#things-schism-doesnt-do\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eSchism's reason for existing is to quickly and easily test netsplits between BEAMS\nand it uses a rudimentary trick with cookies to achieve this goal. This is great\nfor quickly testing your system against faults.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eBut because of Schism's simple nature it should not be considered a replacement\nfor a more robust suite of tests. It \u003cem\u003edoes not\u003c/em\u003e test failed TCP connections,\ninterleaving of messages, race-conditions, clock skew, corruption, or any of\nthe other issues you will see in a distributed system.\u003c/p\u003e\n\u003c/article\u003e","loaded":true,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":[{"level":1,"text":"Schism","anchor":"schism","htmlText":"Schism"},{"level":2,"text":"Installation","anchor":"installation","htmlText":"Installation"},{"level":2,"text":"Usage","anchor":"usage","htmlText":"Usage"},{"level":2,"text":"Things Schism doesn't do","anchor":"things-schism-doesnt-do","htmlText":"Things Schism doesn't do"}],"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Felixir-toniq%2Fschism"}},{"displayName":"LICENSE","repoName":"schism","refName":"master","path":"LICENSE","preferredFileType":"license","tabName":"MIT","richText":null,"loaded":false,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":null,"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Felixir-toniq%2Fschism"}}],"overviewFilesProcessingTime":0}},"appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-7d7eb7c71814.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-708ec8ade250.js","githubDevUrl":null,"enabled_features":{"copilot_workspace":null,"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}}

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Schism

CircleCIDocumentation

Schism provides a simple api for testing partitions between BEAM nodes.

Documentation: https://hexdocs.pm/schism.

Installation

If available in Hex, the package can be installed by adding schism to your list of dependencies in mix.exs:

def deps do
  [
    {:schism, "~> 1.0", only: [:dev, :test]}
  ]
end

Usage

Let's say that we have 5 nodes and we want to test what happens when they disconnect from each other. We can use schism like so:

test "netsplits" do
  [n1, n2, n3, n4, n5] = nodes

  # Partition our nodes
  Schism.partition([n1, n3])
  Schism.partition([n4])
  Schism.partition([n2, n5])

  # Test some stuff...

  # Heal our partitions
  Schism.heal([n1, n3])
  Schism.heal([n2, n4, n5])
end

This api is useful for testing and development in conjunction with tools like local cluster and propcheck.

It is not recommended that you use this in production.

Things Schism doesn't do

Schism's reason for existing is to quickly and easily test netsplits between BEAMS and it uses a rudimentary trick with cookies to achieve this goal. This is great for quickly testing your system against faults.

But because of Schism's simple nature it should not be considered a replacement for a more robust suite of tests. It does not test failed TCP connections, interleaving of messages, race-conditions, clock skew, corruption, or any of the other issues you will see in a distributed system.

0