-
-
Save adamruzicka/3a4681f488e5978c7bd49e544f1ce124 to your computer and use it in GitHub Desktop.
BZ1877917 reproducer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TASKS_ROOT=/opt/theforeman/tfm/root/usr/share/gems/gems/foreman-tasks-4.1.1 | |
cd $TASKS_ROOT | |
if [ ! -d .git ]; then | |
echo "Setting up new git repository" | |
git init . | |
git add . | |
git commit -m 'rpm' | |
git tag rpm | |
else | |
echo "Resetting git repository to rpm tag" | |
git reset --hard rpm | |
fi | |
echo | |
echo "Patching sources" | |
cat <<EOF >app/lib/actions/bz_1877917_reproducer.rb | |
class BZ1877917Reproducer < Dynflow::Action | |
def run(event = nil) | |
output[:counter] ||= (input[:count] || 100).to_i | |
if output[:counter] > 0 | |
output[:counter] -= 1 | |
plan_event(output[:counter]) | |
suspend | |
else | |
raise "Halt" | |
end | |
end | |
end | |
EOF | |
echo | |
echo "Stopping dynflow-sidekiq services" | |
systemctl restart foreman 'dynflow-sidekiq@*' | |
echo | |
echo 'Start a "old-style" dynflow executor with foreman-rake dynflow:executor' | |
echo 'In another terminal run the following command in foreman-rake console:' | |
echo 'ForemanTasks.sync_task(BZ1877917Reproducer, :count => 100)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment