0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/spec/services/video_conversion
Alan Guo Xiang Tan 30896b6d0e
PERF: Run primary and parallel DB setup concurrently in CI (#40319)
Reattempt of #40294, which was reverted in #40301 because two concurrent
processes raced on plugin symlink creation in
`Discourse::Utils.atomic_ln_s`. The first commit here fixes that race at
the source by serializing the check-and-replace with a file lock and
switching to `File.rename` (atomic on POSIX, doesn't follow symlinks at
the destination). A stress test of the previous implementation failed
15/16 workers under contention; the new implementation passes 5/5 stress
runs and 5/5 end-to-end CI-like runs locally with `LOAD_PLUGINS=1`.

The second commit is the parallelization itself: the two CI
database-setup steps run concurrently through GNU `parallel` instead of
one after the other. It also adds `Discourse.test_env_number` to align
the `TEST_ENV_NUMBER=""` interpretation across `FileStore::BaseStore`,
`Stylesheet::Manager`, `S3Helper`, and `BackupRestore::S3BackupStore`
with `config/boot.rb` — without this, the gem's first worker and the
primary process would race on `public/uploads/default/test_0/`.
2026-05-29 06:46:32 +08:00
..
aws_media_convert_adapter_spec.rb PERF: Run primary and parallel DB setup concurrently in CI (#40319) 2026-05-29 06:46:32 +08:00
base_adapter_spec.rb DEV: Update mediaconvert to use a subdirectory for output (#36049) 2025-11-20 14:03:14 -07:00