Skip to content

Commit 3f1736c

Browse files
committed
Revert "Harden macOS test harness compatibility"
This reverts commit ed93933.
1 parent 5e78bc6 commit 3f1736c

5 files changed

Lines changed: 16 additions & 36 deletions

File tree

‎tests/PerformanceHarness/performance_test_basic.py‎

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -642,25 +642,12 @@ def setupTestHelperConfig(args) -> TestHelperConfig:
642642

643643
def setupClusterConfig(args) -> ClusterConfig:
644644

645-
chainPluginArgFields = ChainPluginArgs.__dataclass_fields__
646-
chainPluginArgValues = {
647-
"signatureCpuBillablePct": args.signature_cpu_billable_pct,
648-
"chainThreads": args.chain_threads,
649-
"databaseMapMode": args.database_map_mode,
650-
"wasmRuntime": args.wasm_runtime,
651-
"contractsConsole": args.contracts_console,
652-
"blockLogRetainBlocks": args.block_log_retain_blocks,
653-
"chainStateDbSizeMb": args.chain_state_db_size_mb,
654-
"abiSerializerMaxTimeMs": 990000
655-
}
656-
for optionalArg, value in {
657-
"eosVmOcCacheSizeMb": args.eos_vm_oc_cache_size_mb,
658-
"eosVmOcCompileThreads": args.eos_vm_oc_compile_threads
659-
}.items():
660-
if optionalArg in chainPluginArgFields:
661-
chainPluginArgValues[optionalArg] = value
662-
663-
chainPluginArgs = ChainPluginArgs(**chainPluginArgValues)
645+
chainPluginArgs = ChainPluginArgs(signatureCpuBillablePct=args.signature_cpu_billable_pct,
646+
chainThreads=args.chain_threads, databaseMapMode=args.database_map_mode,
647+
wasmRuntime=args.wasm_runtime, contractsConsole=args.contracts_console,
648+
eosVmOcCacheSizeMb=args.eos_vm_oc_cache_size_mb, eosVmOcCompileThreads=args.eos_vm_oc_compile_threads,
649+
blockLogRetainBlocks=args.block_log_retain_blocks,
650+
chainStateDbSizeMb=args.chain_state_db_size_mb, abiSerializerMaxTimeMs=990000)
664651

665652
producerPluginArgs = ProducerPluginArgs(disableSubjectiveApiBilling=args.disable_subjective_billing,
666653
disableSubjectiveP2pBilling=args.disable_subjective_billing,
@@ -739,11 +726,10 @@ def _createBaseArgumentParser(defEndpointApiDef: str, defProdNodeCnt: int, defVa
739726
ptbBaseParserGroup.add_argument("--wasm-file", type=str, help=argparse.SUPPRESS if suppressHelp else "WASM file name for contract", default="eosio.system.wasm")
740727
ptbBaseParserGroup.add_argument("--abi-file", type=str, help=argparse.SUPPRESS if suppressHelp else "ABI file name for contract", default="eosio.system.abi")
741728
ptbBaseParserGroup.add_argument("--user-trx-data-file", type=str, help=argparse.SUPPRESS if suppressHelp else "Path to transaction data JSON file")
742-
defaultWasmRuntime = ChainPluginArgs()._wasmRuntimeNodeosDefault or "eos-vm"
743729
ptbBaseParserGroup.add_argument("--wasm-runtime", type=str, help=argparse.SUPPRESS if suppressHelp else "Override default WASM runtime (\"eos-vm-jit\", \"eos-vm\")\
744730
\"eos-vm-jit\" : A WebAssembly runtime that compiles WebAssembly code to native x86 code prior to\
745731
execution. \"eos-vm\" : A WebAssembly interpreter.",
746-
choices=["eos-vm-jit", "eos-vm"], default=defaultWasmRuntime)
732+
choices=["eos-vm-jit", "eos-vm"], default="eos-vm-jit")
747733
ptbBaseParserGroup.add_argument("--contracts-console", help=argparse.SUPPRESS if suppressHelp else "print contract's output to console", action='store_true')
748734
ptbBaseParserGroup.add_argument("--eos-vm-oc-cache-size-mb", type=int, help=argparse.SUPPRESS if suppressHelp else "Maximum size (in MiB) of the EOS VM OC code cache", default=1024)
749735
ptbBaseParserGroup.add_argument("--eos-vm-oc-compile-threads", type=int, help=argparse.SUPPRESS if suppressHelp else "Number of threads to use for EOS VM OC tier-up", default=1)

‎tests/TestHarness/testUtils.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ def checkOutput(cmd, ignoreError=False):
193193
return Utils.checkDelayedOutput(popen, cmd, ignoreError=ignoreError)
194194

195195
@staticmethod
196-
def delayedCheckOutput(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=None):
196+
def delayedCheckOutput(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE):
197197
if (isinstance(cmd, list)):
198-
popen=subprocess.Popen(cmd, stdout=stdout, stderr=stderr, cwd=cwd)
198+
popen=subprocess.Popen(cmd, stdout=stdout, stderr=stderr)
199199
else:
200-
popen=subprocess.Popen(cmd, stdout=stdout, stderr=stderr, shell=True, cwd=cwd)
200+
popen=subprocess.Popen(cmd, stdout=stdout, stderr=stderr, shell=True)
201201
return popen
202202

203203
@staticmethod

‎tests/interrupt_read_only_trx_test.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def startCluster():
6767
global total_nodes
6868
global producerNode
6969
global apiNode
70-
global testSuccessful
7170

7271
TestHelper.printSystemInfo("BEGIN")
7372
cluster.setWalletMgr(walletMgr)
@@ -88,8 +87,7 @@ def startCluster():
8887
specificExtraNodeosArgs[pnodes]+=str(args.read_only_threads)
8988
if args.eos_vm_oc_enable:
9089
if platform.system() != "Linux":
91-
Print("OC is only run on Linux. Skip the test")
92-
testSuccessful = True
90+
Print("OC not run on Linux. Skip the test")
9391
exit(0) # Do not fail the test
9492
specificExtraNodeosArgs[pnodes]+=" --eos-vm-oc-enable "
9593
specificExtraNodeosArgs[pnodes]+=args.eos_vm_oc_enable

‎tests/read_only_trx_test.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ def startCluster():
8181
global total_nodes
8282
global producerNode
8383
global apiNode
84-
global testSuccessful
8584

8685
TestHelper.printSystemInfo("BEGIN")
8786
cluster.setWalletMgr(walletMgr)
@@ -116,9 +115,8 @@ def startCluster():
116115
specificExtraNodeosArgs[pnodes]+=str(args.read_only_threads)
117116
if args.eos_vm_oc_enable:
118117
if platform.system() != "Linux":
119-
Print("OC is only run on Linux. Skip the test")
120-
testSuccessful = True
121-
exit(0) # Do not fail the test
118+
Print("OC not run on Linux. Skip the test")
119+
exit(True) # Do not fail the test
122120
specificExtraNodeosArgs[pnodes]+=" --eos-vm-oc-enable "
123121
specificExtraNodeosArgs[pnodes]+=args.eos_vm_oc_enable
124122
if args.wasm_runtime:

‎tests/ship_test.py‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,10 @@
7878
cluster.waitOnClusterSync(blockAdvancing=5)
7979
Print("Cluster in Sync")
8080

81-
shipClient = os.path.abspath("tests/ship_client")
81+
shipClient = "tests/ship_client"
8282
cmd = "%s --num-requests %d" % (shipClient, args.num_requests)
83-
clientCwd = None
8483
if args.unix_socket:
85-
clientCwd = Utils.getNodeDataDir(shipNodeNum)
86-
cmd += " -a ws+unix:///ship.sock"
84+
cmd += " -a ws+unix:///%s" % (Utils.getNodeDataDir(shipNodeNum, "ship.sock"))
8785
if Utils.Debug: Utils.Print("cmd: %s" % (cmd))
8886
clients = []
8987
files = []
@@ -97,7 +95,7 @@
9795
outFile = open("%s%d.out" % (shipClientFilePrefix, i), "w")
9896
errFile = open("%s%d.err" % (shipClientFilePrefix, i), "w")
9997
Print("Start client %d" % (i))
100-
popen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile, cwd=clientCwd)
98+
popen=Utils.delayedCheckOutput(cmd, stdout=outFile, stderr=errFile)
10199
starts.append(time.perf_counter())
102100
clients.append((popen, cmd))
103101
files.append((outFile, errFile))

0 commit comments

Comments
 (0)