From 7c5ebafdecea7a985564c81518a128644bdcb26b Mon Sep 17 00:00:00 2001 From: mwrock Date: Tue, 8 Dec 2020 16:46:04 -0800 Subject: dfgdfg Signed-off-by: mwrock --- omnibus/omnibus-test.ps1 | 16 +--------------- test.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 15 deletions(-) create mode 100644 test.rb diff --git a/omnibus/omnibus-test.ps1 b/omnibus/omnibus-test.ps1 index 99d7ffa9f0..b23239b0ac 100644 --- a/omnibus/omnibus-test.ps1 +++ b/omnibus/omnibus-test.ps1 @@ -60,19 +60,6 @@ $chefdir = gem which chef $chefdir = Split-Path -Path "$chefdir" -Parent $chefdir = Split-Path -Path "$chefdir" -Parent -Copy-Item ./spec/unit/provider/systemd_unit_spec.rb $chefdir/spec/unit/provider/systemd_unit_spec.rb -force -Copy-Item ./lib/chef/provider/systemd_unit.rb $chefdir/lib/chef/provider/systemd_unit.rb -force -Copy-Item Gemfile $chefdir/Gemfile -force -Set-Location -Path $chefdir - -Get-Location - -# ffi-yajl must run in c-extension mode for perf, so force it so we don't accidentally fall back to ffi -$Env:FORCE_FFI_YAJL = "ext" - -# accept license -$Env:CHEF_LICENSE = "accept-no-persist" - bundle If ($lastexitcode -ne 0) { Exit $lastexitcode } @@ -89,11 +76,10 @@ $env:Path = $p # desktop heap exhaustion seems likely (https://docs.microsoft.com/en-us/archive/blogs/ntdebugging/desktop-heap-overview) $exit = 0 -Get-ChildItem Env: (Get-Counter '\Process(*)\% Processor Time').CounterSamples | Where-Object {$_.CookedValue -gt 5} -bundle exec rspec ./spec/unit/provider/systemd_unit_spec.rb:140 +bundle exec ruby test.rb If ($lastexitcode -ne 0) { $exit = 1 } Exit $exit diff --git a/test.rb b/test.rb new file mode 100644 index 0000000000..c03fff8991 --- /dev/null +++ b/test.rb @@ -0,0 +1,8 @@ +require "mixlib/shellout" +require "ruby-prof" +RubyProf.start +c = Mixlib::ShellOut.new(["false", "--system", "is-enabled", "sysstat-collect\\x2d.timer"]) +c.run_command +result = RubyProf.stop +printer = RubyProf::FlatPrinter.new(result) +printer.print(STDOUT) -- cgit v1.2.1