Giter VIP home page Giter VIP logo

circleci-parallelism-option-test's Introduction

circleci-parallelism-option-test CircleCI

Testing the behavior of CircleCI parallelism option

Background

In order to run CircleCI steps in parallel, you need to set a value greater than 1 to the parallelism option first.

version: 2
jobs:
  test:
    docker:
      - image: circleci/node:latest
    parallelism: 3
    ...

Then you can use the CircleCI CLI for spliting tests

circleci tests glob "__test__/*.spec.ts" | circleci tests split --split-by=timing

CircleCI advertises that by passing --split-by=timing to the circleci tests split command, your tests will be split evenly.

To split by test timings, use the --split-by flag with the timings split type. The available timings data will then be analyzed and your tests will be split across your parallel-running containers as evenly as possible leading to the fastest possible test run time

Running Tests in Parallel

There are many strategies that can be potentially used for splitting tests.

One strong candidate is the Greedy Algorithm but it's not always the most optimized one.

So I decided to run the following tests in order to investigate the CircleCI's behavior.

Test Plan

I prepared the following tests.

I investigated how these tests are split when the parallelism option is set as 3.

If CircleCI chooses the most optimized strategy, then the tests should complete within 20 seconds.

Test Result

CircleCI seems to choose the Greedy Algorithm and it ended up with the following result

Container 1

Screen Shot 2022-01-05 at 3 38 33

Container 2

Screen Shot 2022-01-05 at 3 38 51

Container 3

Screen Shot 2022-01-05 at 3 39 03

circleci-parallelism-option-test's People

Contributors

yujiosaka avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.