summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-12 00:20:45 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-12 00:20:45 +0200
commit13c8cb415813e90c883a44b0c0888382161de92a (patch)
tree342f9ffa5f40cf845af40f61852b66f300462d1c
parent92c394b43a0603743b914c6298aab986805ca990 (diff)
Removing a test script that was accidentally committed
-rw-r--r--script12.rb23
1 files changed, 0 insertions, 23 deletions
diff --git a/script12.rb b/script12.rb
deleted file mode 100644
index 659557c..0000000
--- a/script12.rb
+++ /dev/null
@@ -1,23 +0,0 @@
1require 'timeout'
2
3a = Node.root.children.create!(:slug => "cycle_test_a")
4b = a.children.create!(:slug => "cycle_test_b")
5
6a.staged_parent_id = b.id
7a.publish_draft!
8a.reload
9
10puts "a.parent_id after staging a under its own child b: #{a.parent_id.inspect} (b.id = #{b.id})"
11puts "Node.valid? => #{Node.valid?}"
12
13begin
14 Timeout.timeout(3) { puts "a.level => #{a.level}" }
15rescue Timeout::Error
16 puts "TIMED OUT after 3s -- a real cycle and a real infinite loop, confirmed"
17end
18
19# Break any cycle before cleanup -- delete_descendants does its own BFS
20# the same way #level does, and would hang on a real cycle too.
21Node.where(id: a.id).update_all(parent_id: nil)
22b.destroy
23a.destroy