Skip to content

Commit 1a02996

Browse files
Rextilne
authored andcommitted
Fix NFS threads kitchen test for ubuntu18
* Fixing NFS threads kitchen test by forcing check for NFS thread to execute at the end of chef run Signed-off-by: Rex <[email protected]>
1 parent 40bdd00 commit 1a02996

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

recipes/nfs_config.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@
4545
# Explicitly restart NFS server for thread setting to take effect
4646
service node['nfs']['service']['server'] do
4747
action :restart
48+
supports restart: true
4849
end

recipes/tests.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ module load intelmpi && mpirun --help | grep '#{node['cfncluster']['intelmpi']['
502502

503503
# Skip nfs thread test for ubuntu16 because nfs thread enhancement is omitted
504504
unless node['platform'] == 'ubuntu' && node['platform_version'].to_f == 16.04
505-
ruby_block 'check nfs threads' do
505+
ruby_block 'check_nfs_threads' do
506506
block do
507507
nfs_threads = shell_out!("cat /proc/net/rpc/nfsd | grep th | awk '{print$2}'").stdout.strip.to_i
508508
Chef::Log.debug("nfs threads configured on machine is #{nfs_threads}")
@@ -511,6 +511,15 @@ module load intelmpi && mpirun --help | grep '#{node['cfncluster']['intelmpi']['
511511
raise "Expected number of nfs threads configured to be #{expected_threads} but is actually #{nfs_threads}"
512512
end
513513
end
514+
action :nothing
515+
end
516+
517+
# Execute thread check at the end of chef run
518+
ruby_block 'delay thread check' do
519+
block do
520+
true
521+
end
522+
notifies :run, "ruby_block[check_nfs_threads]", :delayed
514523
end
515524
end
516525

0 commit comments

Comments
 (0)