Fray Idea Plugin allows you to control concurrent programs in your Intellij IDE!
-
Using the IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "Fray Debugger" > Install
-
Using JetBrains Marketplace:
Go to JetBrains Marketplace and install it by clicking the Install to ... button in case your IDE is running.
You can also download the latest release from JetBrains Marketplace and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
Fray Debugger Plugin provides an interactive interface to control the execution of concurrent programs. To start
Fray Debugger, you may select Debug (Fray)
from the Run/Debug Configurations dropdown:
Once the test is launched, Fray Debugger Plugin will pause the program execution at each synchronization point. You can then control the execution of the program using the Fray Debugger Plugin interface:
The dropdown manu shows all threads in the program. You can select a thread to view its stack trace.
In the editor, Fray also shows the current line of execution and the thread name.
Once you have decided which thread to schedule, you can click the Schedule
button to schedule the selected thread.
Note that a thread may note be scheduled if it is blocked or if it is not ready to run. Such a thread will
be marked as Paused
.
You can launch Fray tests from the IDE and debug them as you would with any other JUnit test.
Select frayTest
from the Gradle tool window to run all Fray tests in the project.
Warning
Fray debugger plugin only works with tests annotated with @ConcurrencyTest
right now.
By default Intellij calls toString
to display the value of
local variables. This may trigger unnecssary schedules in Fray (e.g., if the toString
method contains concurrency
primitives). This makes Fray replay nondeterministic.
To disable Intellij toString
evaluation,
go to File -> Settings -> Build, Execution, Deployment -> Debugger -> Data Views -> Java
uncheck Enable toString object view
.