File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
packages/react-native-fantom/runner Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ import os from 'os';
1616// $FlowExpectedError[untyped-import]
1717import { SourceMapConsumer } from 'source-map' ;
1818
19+ const BUCK_ISOLATION_DIR = 'react-native-fantom-buck-out' ;
20+
1921export function getBuckModeForPlatform ( enableRelease : boolean = false ) : string {
2022 const mode = enableRelease ? 'opt' : 'dev' ;
2123
@@ -40,6 +42,16 @@ type SpawnResultWithOriginalCommand = {
4042} ;
4143
4244export function runBuck2 ( args : Array < string > ) : SpawnResultWithOriginalCommand {
45+ // If these tests are already running from withing a buck2 process, e.g. when
46+ // they are scheduled by a `buck2 test` wrapper, calling `buck2` again would
47+ // cause a daemon-level deadlock.
48+ // To prevent this - explicitly pass custom `--isolation-dir`. Reuse the same
49+ // dir across tests (even running in different jest processes) to properly
50+ // employ caching.
51+ if ( process . env . BUCK2_WRAPPER != null ) {
52+ args . unshift ( '--isolation-dir' , BUCK_ISOLATION_DIR ) ;
53+ }
54+
4355 const result = spawnSync ( 'buck2' , args , {
4456 encoding : 'utf8' ,
4557 env : {
You can’t perform that action at this time.
0 commit comments