Skip to content
プロジェクト

概要

JVM向けの制御された並行処理テストフレームワークです。

開発ツール

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
+2
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Fray: General-Purpose Concurrency Testing

Build Gradle Maven JetBrain Plugin Discord

logo

Fray is a concurrency testing tool for Java that can help you find and debug tricky race conditions that manifest as assertion violations, run-time exceptions, or deadlocks. It performs controlled concurrency testing using state-of-the-art techniques such as probabilistic concurrency testing or partial order sampling. Fray also provides deterministic replay capabilities for debugging specific thread interleavings. Fray is designed to be easy to use and can be integrated into existing testing frameworks.

Quick Start

Native agents are built and published for Linux (x86-64 and ARM64), Windows (x86-64), and macOS (ARM64). The Gradle and Maven plugins select the agent for the current platform.

JUnit 5

If you are using JUnit 5, you can use the @FrayTest annotation to mark a test as a concurrency test. You also need to add the @ExtendWith(FrayTestExtension.class) annotation to the test class.

import org.pastalab.fray.junit.junit5.FrayTestExtension;
import org.pastalab.fray.junit.junit5.annotations.FrayTest;

@ExtendWith(FrayTestExtension.class)
public class SimpleTest {
    @FrayTest
    public void concurrencyTest() {
        ... // some multithreaded code
        assert(...);
    }
}

Note: The Fray debugger IDE plugin currently only supports tests annotated with @ConcurrencyTest. If you want to use the debugger, follow the instructions in docs/IDE.md and use @ConcurrencyTest instead of @FrayTest for now.

Other Testing Frameworks

Fray can be used with other testing frameworks as well. You may use the FrayInTestLauncher

import org.pastalab.fray.junit.plain.FrayInTestLauncher;

public void test() {
    FrayInTestLauncher.INSTANCE.launchFrayTest(() -> {
        ... // some multithreaded code
        assert(...);
    });
}

Gradle

To use Fray with Gradle, add the following plugin to your build.gradle file:

plugins {
    id("org.pastalab.fray.gradle") version "0.9.2"
}

Maven

  • First please add Fray plugin to your project
<plugin>
    <groupId>org.pastalab.fray.maven</groupId>
    <artifactId>fray-plugins-maven</artifactId>
    <version>0.9.2</version>
    <executions>
        <execution>
            <id>prepare-fray</id>
            <goals>
                <goal>prepare-fray</goal>
            </goals>
        </execution>
    </executions>
</plugin>
  • Next, please add the fray-junit dependency
<dependency>
    <groupId>org.pastalab.fray</groupId>
    <artifactId>fray-junit</artifactId>
    <version>0.9.2</version>
    <scope>test</scope>
</dependency>

Documentation

Contributing

Contributions to Fray are both welcomed and appreciated! Please see our contributing guide for more information on how to contribute to Fray.

Publications and Media

Fray's design and evaluation is described in the following research paper (please cite this if you are referencing Fray from any other work):

Ao Li, Byeongjee Kang, Vasudev Vikram, Isabella Laybourn, Samvid Dharanikota, Shrey Tiwari, and Rohan Padhye. 2025. Fray: An Efficient General-Purpose Concurrency Testing Platform for the JVM. Proc. ACM Program. Lang. 9, OOPSLA2, Article 417 (October 2025), 28 pages. https://doi.org/10.1145/3764119

An extended version of the paper with detailed formalizations and proofs is available at: https://arxiv.org/abs/2501.12618

Talks about Fray have been given at the following venues:

Acknowledgements

This material is based upon work supported in part by the National Science Foundation and by an Amazon Research Award.

Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of any sponsor.

Tooling provided by

JetBrains logo.

関連プロジェクトを探す

読み込み中…