# Run rake spec in parallel

**URL:** https://meta.discourse.org/t/run-rake-spec-in-parallel/217275
**Category:** Development
**Created:** [February 6, 2022, 7:22pm UTC](https://meta.discourse.org/t/run-rake-spec-in-parallel/217275 "2022-02-06T19:22:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rrit](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@rrit](https://meta.discourse.org/u/rrit)
#### Post date: [February 6, 2022, 7:22pm UTC](https://meta.discourse.org/t/run-rake-spec-in-parallel/217275/1 "2022-02-06T19:22:32Z")

</div>

By chance has anyone already running the rake spec tasks in parallel?

[https://github.com/grosser/parallel\_tests](https://github.com/grosser/parallel_tests)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [February 6, 2022, 7:38pm UTC](https://meta.discourse.org/t/run-rake-spec-in-parallel/217275/2 "2022-02-06T19:38:02Z")

</div>

We run our tests in parallel during CI, and also during local development. To try it out, you can run:

```plaintext
bin/rake parallel:create
bin/rake parallel:migrate
bin/turbo_rspec

```

---

<div class="post-metadata">

### Author: ![rrit](https://avatars.discourse-cdn.com/v4/letter/r/b5ac83/32.png) [@rrit](https://meta.discourse.org/u/rrit)
#### Post date: [February 6, 2022, 8:12pm UTC](https://meta.discourse.org/t/run-rake-spec-in-parallel/217275/3 "2022-02-06T20:12:00Z")

</div>

Thank you, this is pretty cool!

To make it run in my local dev environment I first had to fix:

> **ERROR: permission denied to create database**
>
> ```plaintext
> Tasks: TOP => db:create
> (See full trace by running task with --trace)
> PG::InsufficientPrivilege: ERROR: permission denied to create database
> Couldn't create 'discourse_test_32' database. Please check your configuration.
> rake aborted!
> ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: permission denied to create database
> 
> Caused by:
> PG::InsufficientPrivilege: ERROR: permission denied to create database
> 
> ```

```bash
# switch into container
d/shell_root

# inside container - root@discourse:/#
sudo -u postgres psql

# psql - postgres=#
ALTER USER discourse CREATEDB;
exit

# inside container - root@discourse:/#
exit

```

And now it works even inside the container:

```bash
d/rake parallel:create
d/rake parallel:migrate
d/exec bin/turbo_rspec

```

Finished in 3 minutes 11.6 seconds (files took 0 seconds to load) 🚀  
16015 examples, 12 failures, 10 pending, 3 errors occurred outside of examples
