From nobody at rubyforge.org Wed Jun 6 18:13:58 2007 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 6 Jun 2007 18:13:58 -0400 (EDT) Subject: [Archipelago-submits] [320] trunk/archipelago: made the tests use proper timeouts when needed, now that the default timeout is generally zero for lookups. Message-ID: <20070606221358.4C3465240B6B@rubyforge.org> Revision: 320 Author: zond Date: 2007-06-06 18:13:57 -0400 (Wed, 06 Jun 2007) Log Message: ----------- made the tests use proper timeouts when needed, now that the default timeout is generally zero for lookups. added possibility to make silent lookups, that wont spam the network. added ServiceDescriptions#hash to make them Hash and Set friendly. moved around some stuff in disco hoping to get rid of the fucking thread problems but failing (release a fix to 1.8.6 already!!!). made dump test work (how the hell did it work before?). made Dubloons more honest, when needed, as to their class. started using the dubloons own checking instead of === when checking if things are dubloons, to make it work with subclasses. Modified Paths: -------------- trunk/archipelago/lib/archipelago/client.rb trunk/archipelago/lib/archipelago/disco.rb trunk/archipelago/lib/archipelago/sanitation.rb trunk/archipelago/lib/archipelago/treasure.rb trunk/archipelago/tests/disco_test.rb Modified: trunk/archipelago/lib/archipelago/client.rb =================================================================== --- trunk/archipelago/lib/archipelago/client.rb 2007-05-30 15:57:12 UTC (rev 319) +++ trunk/archipelago/lib/archipelago/client.rb 2007-06-06 22:13:57 UTC (rev 320) @@ -104,6 +104,8 @@ # def update_services!(options = {}) timeout = options[:timeout] || 0 + silent = options[:silent] || false + validate = options[:validate] || false around_update_services do @service_descriptions.each do |name, description| @@ -120,7 +122,7 @@ # more than on average once every MAXIMUM_SERVICE_UPDATE_INTERVAL, so that MAY make it worthwhile to do # the RBTree song and dance in here. Hopefully. # - new_services = @jockey.lookup(Archipelago::Disco::Query.new(description), timeout) + new_services = @jockey.lookup(Archipelago::Disco::Query.new(description), :timeout => timeout, :silent => silent) new_services.convert_to_tree! new_services.validate! if validate @services[name] = new_services Modified: trunk/archipelago/lib/archipelago/disco.rb =================================================================== --- trunk/archipelago/lib/archipelago/disco.rb 2007-05-30 15:57:12 UTC (rev 319) +++ trunk/archipelago/lib/archipelago/disco.rb 2007-06-06 22:13:57 UTC (rev 320) @@ -80,6 +80,7 @@ # can include this for simplicity. # module Camel + attr_reader :jockey private # # Setup our @jockey as a Archipelago::Disco::Jockey with given options. @@ -311,6 +312,14 @@ @attributes = hash end # + # To make it Hash and Set friendly. + # + def hash + @attributes.inject(0) do |sum, pair| + sum + pair.first.hash + pair.last.hash + end + end + # # Returns whether our @attributes are equal to that of +o+. # def eql?(o) @@ -504,6 +513,9 @@ # Will listen for +event_type+s matching the Query +match+ # and do +block+.call with the matching Record. # + # +identity+ is used to determine what subscription to remove + # when doing unsubscribe. + # # Recognized +event_types+: :found, :lost # def subscribe(event_type, match, identity, &block) @@ -511,7 +523,7 @@ end # - # Will stop listening for +event_type+ and +match+. + # Will stop listening for +event_type+ and +match+ with +identity+. # def unsubscribe(event_type, match, identity) @service_change_subscribers_by_event_type[event_type].delete([match, identity]) @@ -589,13 +601,13 @@ @listener_thread.kill @unilistener_thread.kill + @listener.close + @unilistener.close while !@incoming.empty? sleep 0.1 end @picker_thread.kill - @listener.close - @unilistener.close - + while !@outgoing.empty? sleep 0.1 end @@ -608,25 +620,29 @@ end # - # Lookup any services matching +match+, optionally with a +timeout+. + # Lookup any services matching +match+, optionally + # with a +:timeout+ and optionally +:silent+. # # Will immediately return if we know of matching and valid services, # will otherwise send out regular Queries and return as soon as # matching services are found, or when the +timeout+ runs out. # - def lookup(match, timeout = @lookup_timeout) + def lookup(match, options = {}) + timeout = options[:timeout] || @lookup_timeout + silent = options[:silent] || false + match[:unicast_reply] = @unicast_address @subscribed_services << match if @thrifty_caching standoff = @initial_lookup_standoff - @outgoing << [nil, match] + @outgoing << [nil, match] unless silent known_services = @remote_services.get_services(match).merge(@local_services.get_services(match)) return known_services if timeout == 0 || !known_services.empty? t = Time.new @new_service_semaphore.wait([standoff, timeout].min) standoff *= 2 - + while Time.new < t + timeout known_services = @remote_services.get_services(match).merge(@local_services.get_services(match)) return known_services unless known_services.empty? @@ -635,10 +651,10 @@ @new_service_semaphore.wait(wait_time) standoff *= 2 - @outgoing << [nil, match] + @outgoing << [nil, match] unless silent end - ServiceLocker.new + return ServiceLocker.new end # Modified: trunk/archipelago/lib/archipelago/sanitation.rb =================================================================== --- trunk/archipelago/lib/archipelago/sanitation.rb 2007-05-30 15:57:12 UTC (rev 319) +++ trunk/archipelago/lib/archipelago/sanitation.rb 2007-06-06 22:13:57 UTC (rev 320) @@ -95,7 +95,7 @@ options.merge!({ :service_descriptions => { - :sites => Archipelago::Disco::Query.new(SITE_DESCRIPTION.merge(options[:site_description] || {})) + :sites => SITE_DESCRIPTION.merge(options[:site_description] || {}) } }) setup_client(options) Modified: trunk/archipelago/lib/archipelago/treasure.rb =================================================================== --- trunk/archipelago/lib/archipelago/treasure.rb 2007-05-30 15:57:12 UTC (rev 319) +++ trunk/archipelago/lib/archipelago/treasure.rb 2007-06-06 22:13:57 UTC (rev 320) @@ -123,6 +123,13 @@ @@debug_callable = c end # + # Will return whether +o+ is an instance of Dubloon or one + # of its subclasses. + # + def self.dubloon?(o) + return o.respond_to?(:dubloon?) && o.dubloon? + end + # # Remove all methods so that we look like our target. # instance_methods.each do |method| @@ -142,12 +149,18 @@ self.==(o) end # - # If o is a Dubloon, will return true if it has the same Dubloon#object_id. + # Will return that this is a Dubloon. # + def dubloon? + true + end + # + # If +o+ is a Dubloon, will return true if it has the same Dubloon#object_id. + # # Otherwise will defer to Dubloon#method_missing. # def ==(o) - if Dubloon === o + if Dubloon.dubloon?(o) return true if self.object_id == o.object_id end return self.method_missing(:==, o) @@ -206,7 +219,7 @@ # @chest_id, @key and possibly @transaction. # def object_id - id = "#{@chest_id}:#{@key}" + id = "Archipelago::Treasure::Dubloon:#{@key}@#{@chest_id}" id << ":#{@transaction.transaction_id}" if @transaction return id end @@ -295,6 +308,8 @@ # include Archipelago::Disco::Publishable + attr_reader :captain + # # Initialize a Chest # @@ -444,7 +459,7 @@ instance = ensure_instance_with_transaction(key, transaction) return nil unless instance - if Dubloon === instance + if Dubloon.dubloon?(instance) return instance.join(transaction) else return Dubloon.new(key, self, transaction, self.service_id) @@ -896,7 +911,7 @@ # def set(key, value, transaction) join!(transaction) - if Dubloon === value + if Dubloon.dubloon?(value) value.assert_transaction(transaction) # # Return the value if the value is in fact a proxy to what we are trying overwrite. @@ -926,7 +941,7 @@ @db[key] = value end - return value if Dubloon === value + return value if Dubloon.dubloon?(value) return Dubloon.new(key, self, transaction, service_id) end Modified: trunk/archipelago/tests/disco_test.rb =================================================================== --- trunk/archipelago/tests/disco_test.rb 2007-05-30 15:57:12 UTC (rev 319) +++ trunk/archipelago/tests/disco_test.rb 2007-06-06 22:13:57 UTC (rev 320) @@ -24,7 +24,7 @@ :validator => DRbObject.new(@v1), :epa => "blar") @d1.publish(@p1) - assert(!@d2.lookup(Archipelago::Disco::Query.new(:epa => "blar")).empty?) + assert(!@d2.lookup(Archipelago::Disco::Query.new(:epa => "blar"), :timeout => 2).empty?) @listener = UDPSocket.new @listener.setsockopt(Socket::IPPROTO_IP, @@ -76,7 +76,7 @@ empty = true Thread.new do - empty = @d2.lookup(Archipelago::Disco::Query.new(:epa => "blar2")).empty? + empty = @d2.lookup(Archipelago::Disco::Query.new(:epa => "blar2"), :timeout => 2).empty? end assert(empty) @@ -103,7 +103,7 @@ end @d2.unsubscribe(:lost, Archipelago::Disco::Query.new(:epa => "blar"), 1) - assert(@d2.lookup(Archipelago::Disco::Query.new(:epa => "blar"), 0).validate!.empty?) + assert(@d2.lookup(Archipelago::Disco::Query.new(:epa => "blar"), :timeout => 0).validate!.empty?) @d2.validate! @@ -119,7 +119,7 @@ lost_it = true end - assert(@d2.lookup(Archipelago::Disco::Query.new(:epa => "blar"), 0).validate!.empty?) + assert(@d2.lookup(Archipelago::Disco::Query.new(:epa => "blar"), :timeout => 0).validate!.empty?) @d2.validate! @@ -143,7 +143,7 @@ end @d2.unsubscribe(:lost, Archipelago::Disco::Query.new(:epa => "blarx"), 2) - assert(@d2.lookup(Archipelago::Disco::Query.new(:epa => "blar"), 0).validate!.empty?) + assert(@d2.lookup(Archipelago::Disco::Query.new(:epa => "blar"), :timeout => 0).validate!.empty?) @d2.validate! @@ -180,7 +180,7 @@ assert(@ltq.empty?, "we got messages while we shouldnt: #{@ltq.inspect}") c1 = Archipelago::Disco::Jockey.new(:thrifty_publishing => true) - assert(!c1.lookup(Archipelago::Disco::Query.new(:glad => "ja")).empty?) + assert(!c1.lookup(Archipelago::Disco::Query.new(:glad => "ja"), :timeout => 2).empty?) c1.stop! c3.stop! @@ -192,7 +192,7 @@ :service_id => 3444)) @ltq.clear - assert(!@d2.lookup(Archipelago::Disco::Query.new(:gladaa => "jaaa")).empty?) + assert(!@d2.lookup(Archipelago::Disco::Query.new(:gladaa => "jaaa"), :timeout => 2).empty?) assert(@ltq.any? do |d| o = Marshal.load(d) case o @@ -214,7 +214,7 @@ @ltq.clear c1 = Archipelago::Disco::Jockey.new - assert(!c1.lookup(Archipelago::Disco::Query.new(:glad2 => "ja2"), 2).empty?) + assert(!c1.lookup(Archipelago::Disco::Query.new(:glad2 => "ja2"), :timeout => 2).empty?) assert(!@ltq.any? do |data| o = Marshal.load(data) From nobody at rubyforge.org Wed Jun 6 18:27:03 2007 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 6 Jun 2007 18:27:03 -0400 (EDT) Subject: [Archipelago-submits] [321] trunk/hyperactive: upgraded all tests to work with newer archipelago. Message-ID: <20070606222703.DCDB75240B6B@rubyforge.org> Revision: 321 Author: zond Date: 2007-06-06 18:27:03 -0400 (Wed, 06 Jun 2007) Log Message: ----------- upgraded all tests to work with newer archipelago. made lists not return anything when unlinking. Modified Paths: -------------- trunk/hyperactive/lib/hyperactive/list.rb trunk/hyperactive/lib/hyperactive/record.rb trunk/hyperactive/tests/hash_benchmark.rb trunk/hyperactive/tests/hash_test.rb trunk/hyperactive/tests/list_benchmark.rb trunk/hyperactive/tests/list_test.rb trunk/hyperactive/tests/record_test.rb trunk/hyperactive/tests/test_helper.rb trunk/hyperactive/tests/tree_test.rb Modified: trunk/hyperactive/lib/hyperactive/list.rb =================================================================== --- trunk/hyperactive/lib/hyperactive/list.rb 2007-06-06 22:13:57 UTC (rev 320) +++ trunk/hyperactive/lib/hyperactive/list.rb 2007-06-06 22:27:03 UTC (rev 321) @@ -101,6 +101,7 @@ end self.size -= 1 element.destroy! + return nil end # Modified: trunk/hyperactive/lib/hyperactive/record.rb =================================================================== --- trunk/hyperactive/lib/hyperactive/record.rb 2007-06-06 22:13:57 UTC (rev 320) +++ trunk/hyperactive/lib/hyperactive/record.rb 2007-06-06 22:27:03 UTC (rev 321) @@ -138,6 +138,7 @@ Archipelago::Pirate::BLACKBEARD.delete(@record_id, @transaction) self.freeze end + return nil end module ClassMethods Modified: trunk/hyperactive/tests/hash_benchmark.rb =================================================================== --- trunk/hyperactive/tests/hash_benchmark.rb 2007-06-06 22:13:57 UTC (rev 320) +++ trunk/hyperactive/tests/hash_benchmark.rb 2007-06-06 22:27:03 UTC (rev 321) @@ -3,32 +3,6 @@ class HashBenchmark < Test::Unit::TestCase - def setup - @c = TestChest.new(:persistence_directory => Pathname.new(__FILE__).parent.join("chest.db")) - @c.publish! - @c2 = TestChest.new(:persistence_directory => Pathname.new(__FILE__).parent.join("chest2.db")) - @c2.publish! - @tm = TestManager.new(:persistence_directory => Pathname.new(__FILE__).parent.join("tranny1.db")) - @tm.publish! - Archipelago::Pirate::BLACKBEARD.setup(:chest_description => {:class => 'TestChest'}, - :tranny_description => {:class => 'TestManager'}) - assert_within(20) do - Set.new(Archipelago::Pirate::BLACKBEARD.chests.keys) == Set.new([@c.service_id, @c2.service_id]) - end - assert_within(20) do - Archipelago::Pirate::BLACKBEARD.trannies.keys == [@tm.service_id] - end - end - - def teardown - @c.stop! - @c.persistence_provider.unlink! - @c2.stop! - @c2.persistence_provider.unlink! - @tm.stop! - @tm.persistence_provider.unlink! - end - def test_set_get h = Hyperactive::Hash::Head.get_instance r = Hyperactive::Record::Bass.get_instance Modified: trunk/hyperactive/tests/hash_test.rb =================================================================== --- trunk/hyperactive/tests/hash_test.rb 2007-06-06 22:13:57 UTC (rev 320) +++ trunk/hyperactive/tests/hash_test.rb 2007-06-06 22:27:03 UTC (rev 321) @@ -11,33 +11,7 @@ end class HashTest < Test::Unit::TestCase - - def setup - @c = TestChest.new(:persistence_directory => Pathname.new(__FILE__).parent.join("chest.db")) - @c.publish! - @c2 = TestChest.new(:persistence_directory => Pathname.new(__FILE__).parent.join("chest2.db")) - @c2.publish! - @tm = TestManager.new(:persistence_directory => Pathname.new(__FILE__).parent.join("tranny1.db")) - @tm.publish! - assert_within(10) do - Archipelago::Pirate::BLACKBEARD.update_services! - Archipelago::Pirate::BLACKBEARD.chests.keys.sort == [@c.service_id, @c2.service_id].sort - end - assert_within(10) do - Archipelago::Pirate::BLACKBEARD.update_services! - Archipelago::Pirate::BLACKBEARD.trannies.keys == [@tm.service_id] - end - end - def teardown - @c.stop! - @c.persistence_provider.unlink! - @c2.stop! - @c2.persistence_provider.unlink! - @tm.stop! - @tm.persistence_provider.unlink! - end - def test_select_reject h = Hyperactive::Hash::Head.get_instance r1 = Hyperactive::Record::Bass.get_instance Modified: trunk/hyperactive/tests/list_benchmark.rb =================================================================== --- trunk/hyperactive/tests/list_benchmark.rb 2007-06-06 22:13:57 UTC (rev 320) +++ trunk/hyperactive/tests/list_benchmark.rb 2007-06-06 22:27:03 UTC (rev 321) @@ -3,32 +3,6 @@ class ListBenchmark < Test::Unit::TestCase - def setup - @c = TestChest.new(:persistence_provider => Archipelago::Hashish::BerkeleyHashishProvider.new(Pathname.new(__FILE__).parent.join("chest.db"))) - @c.publish! - @c2 = TestChest.new(:persistence_provider => Archipelago::Hashish::BerkeleyHashishProvider.new(Pathname.new(__FILE__).parent.join("chest2.db"))) - @c2.publish! - @tm = TestManager.new(:persistence_provider => Archipelago::Hashish::BerkeleyHashishProvider.new(Pathname.new(__FILE__).parent.join("tranny1.db"))) - @tm.publish! - Archipelago::Pirate::BLACKBEARD.setup(:chest_description => {:class => 'TestChest'}, - :tranny_description => {:class => 'TestManager'}) - assert_within(20) do - Set.new(Archipelago::Pirate::BLACKBEARD.chests.keys) == Set.new([@c.service_id, @c2.service_id]) - end - assert_within(20) do - Archipelago::Pirate::BLACKBEARD.trannies.keys == [@tm.service_id] - end - end - - def teardown - @c.stop! - @c.persistence_provider.unlink! - @c2.stop! - @c2.persistence_provider.unlink! - @tm.stop! - @tm.persistence_provider.unlink! - end - def test_set_get l = Hyperactive::List::Head.get_instance r = Hyperactive::Record::Bass.get_instance Modified: trunk/hyperactive/tests/list_test.rb =================================================================== --- trunk/hyperactive/tests/list_test.rb 2007-06-06 22:13:57 UTC (rev 320) +++ trunk/hyperactive/tests/list_test.rb 2007-06-06 22:27:03 UTC (rev 321) @@ -11,54 +11,19 @@ class ListTest < Test::Unit::TestCase - def setup - @c = TestChest.new(:persistence_directory => Pathname.new(__FILE__).parent.join("chest.db")) - @c.publish! - @c2 = TestChest.new(:persistence_directory => Pathname.new(__FILE__).parent.join("chest2.db")) - @c2.publish! - @tm = TestManager.new(:persistence_directory => Pathname.new(__FILE__).parent.join("tranny1.db")) - @tm.publish! - Archipelago::Pirate::BLACKBEARD.setup(:chest_description => {:class => 'TestChest'}, - :tranny_description => {:class => 'TestManager'}) - assert_within(10) do - Archipelago::Pirate::BLACKBEARD.update_services! - Archipelago::Pirate::BLACKBEARD.chests.keys.sort == [@c.service_id, @c2.service_id].sort - end - assert_within(10) do - Archipelago::Pirate::BLACKBEARD.update_services! - Archipelago::Pirate::BLACKBEARD.trannies.keys == [@tm.service_id] - end - end - - def teardown - @c.close! - @c.persistence_provider.unlink! - @c2.close! - @c2.persistence_provider.unlink! - @tm.close! - @tm.persistence_provider.unlink! - end - def test_clear - puts "running test_clear" - puts "creating head" l = Hyperactive::List::Head.get_instance - puts "adding record" l << (r = Hyperactive::Record::Bass.get_instance) - puts "asserting size, first and last" assert_equal(1, l.size) assert_equal(r, l.first) assert_equal(r, l.last) - puts "clearing" l.clear! - puts "asserting size first and last" assert_equal(0, l.size) assert_equal(nil, l.first) assert_equal(nil, l.last) end def test_destroy - puts "running test_destroy" l = Hyperactive::List::Head.get_instance l << (r = Hyperactive::Record::Bass.get_instance) r1 = l.first_element.record_id @@ -69,7 +34,6 @@ end def test_each - puts "running test_each" l = Hyperactive::List::Head.get_instance l << (r = Hyperactive::Record::Bass.get_instance) l << (r2 = Hyperactive::Record::Bass.get_instance) @@ -83,7 +47,6 @@ end def test_unlink - puts "running test_unlink" l = Hyperactive::List::Head.get_instance l << (r = Hyperactive::Record::Bass.get_instance) l << (r2 = Hyperactive::Record::Bass.get_instance) @@ -107,7 +70,6 @@ end def test_push_unshift_pop_shift - puts "running test_push_unshift_pop_shift" l = Hyperactive::List::Head.get_instance assert_equal(0, l.size) l << (r = Hyperactive::Record::Bass.get_instance) Modified: trunk/hyperactive/tests/record_test.rb =================================================================== --- trunk/hyperactive/tests/record_test.rb 2007-06-06 22:13:57 UTC (rev 320) +++ trunk/hyperactive/tests/record_test.rb 2007-06-06 22:27:03 UTC (rev 321) @@ -31,20 +31,7 @@ class RecordTest < Test::Unit::TestCase def setup - @c = TestChest.new(:persistence_directory => Pathname.new(__FILE__).parent.join("chest.db")) - @c.publish! - @c2 = TestChest.new(:persistence_directory => Pathname.new(__FILE__).parent.join("chest2.db")) - @c2.publish! - @tm = TestManager.new(:persistence_directory => Pathname.new(__FILE__).parent.join("tranny1.db")) - @tm.publish! - assert_within(10) do - Archipelago::Pirate::BLACKBEARD.update_services! - Archipelago::Pirate::BLACKBEARD.chests.keys.sort == [@c.service_id, @c2.service_id].sort - end - assert_within(10) do - Archipelago::Pirate::BLACKBEARD.update_services! - Archipelago::Pirate::BLACKBEARD.trannies.keys == [@tm.service_id] - end + super $BEFORE_SAVE = 0 $AFTER_SAVE = 0 $BEFORE_DESTROY = 0 @@ -53,15 +40,6 @@ $AFTER_CREATE = 0 end - def teardown - @c.close! - @c.persistence_provider.unlink! - @c2.close! - @c2.persistence_provider.unlink! - @tm.close! - @tm.persistence_provider.unlink! - end - def test_index_find MyRecord.class_eval do index_by :bajs Modified: trunk/hyperactive/tests/test_helper.rb =================================================================== --- trunk/hyperactive/tests/test_helper.rb 2007-06-06 22:13:57 UTC (rev 320) +++ trunk/hyperactive/tests/test_helper.rb 2007-06-06 22:27:03 UTC (rev 321) @@ -72,4 +72,32 @@ assert(rval) end + def setup + Archipelago::Pirate::BLACKBEARD.setup(:chest_description => {:class => 'TestChest'}, + :tranny_description => {:class => 'TestManager'}) + @c = TestChest.new(:persistence_directory => Pathname.new(__FILE__).parent.join("chest.db")) + @c.publish! + @c2 = TestChest.new(:persistence_directory => Pathname.new(__FILE__).parent.join("chest2.db")) + @c2.publish! + @tm = TestManager.new(:persistence_directory => Pathname.new(__FILE__).parent.join("tranny1.db")) + @tm.publish! + assert_within(10) do + Archipelago::Pirate::BLACKBEARD.update_services! + Archipelago::Pirate::BLACKBEARD.chests.keys.sort == [@c.service_id, @c2.service_id].sort + end + assert_within(10) do + Archipelago::Pirate::BLACKBEARD.update_services! + Archipelago::Pirate::BLACKBEARD.trannies.keys == [@tm.service_id] + end + end + + def teardown + @c.close! + @c.persistence_provider.unlink! + @c2.close! + @c2.persistence_provider.unlink! + @tm.close! + @tm.persistence_provider.unlink! + end + end Modified: trunk/hyperactive/tests/tree_test.rb =================================================================== --- trunk/hyperactive/tests/tree_test.rb 2007-06-06 22:13:57 UTC (rev 320) +++ trunk/hyperactive/tests/tree_test.rb 2007-06-06 22:27:03 UTC (rev 321) @@ -3,33 +3,6 @@ class TreeTest < Test::Unit::TestCase - def setup - @c = TestChest.new(:persistence_provider => Archipelago::Hashish::BerkeleyHashishProvider.new(Pathname.new(__FILE__).parent.join("chest.db"))) - @c.publish! - @c2 = TestChest.new(:persistence_provider => Archipelago::Hashish::BerkeleyHashishProvider.new(Pathname.new(__FILE__).parent.join("chest2.db"))) - @c2.publish! - @tm = TestManager.new(:persistence_provider => Archipelago::Hashish::BerkeleyHashishProvider.new(Pathname.new(__FILE__).parent.join("tranny1.db"))) - @tm.publish! - Archipelago::Pirate::BLACKBEARD.setup(:chest_description => {:class => 'TestChest'}, - :tranny_description => {:class => 'TestManager'}) - Archipelago::Pirate::BLACKBEARD.update_services! - assert_within(10) do - Archipelago::Pirate::BLACKBEARD.chests.keys.sort == [@c.service_id, @c2.service_id].sort - end - assert_within(10) do - Archipelago::Pirate::BLACKBEARD.trannies.keys == [@tm.service_id] - end - end - - def teardown - @c.stop! - @c.persistence_provider.unlink! - @c2.stop! - @c2.persistence_provider.unlink! - @tm.stop! - @tm.persistence_provider.unlink! - end - def test_insert t = Hyperactive::Tree::Root.get_instance assert(t.root.nil_node?) From nobody at rubyforge.org Wed Jun 6 18:31:03 2007 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 6 Jun 2007 18:31:03 -0400 (EDT) Subject: [Archipelago-submits] [322] trunk/archipelago/tests/disco_benchmark.rb: added timeouts where necessary Message-ID: <20070606223103.9000A5240B7B@rubyforge.org> Revision: 322 Author: zond Date: 2007-06-06 18:31:03 -0400 (Wed, 06 Jun 2007) Log Message: ----------- added timeouts where necessary Modified Paths: -------------- trunk/archipelago/tests/disco_benchmark.rb Modified: trunk/archipelago/tests/disco_benchmark.rb =================================================================== --- trunk/archipelago/tests/disco_benchmark.rb 2007-06-06 22:27:03 UTC (rev 321) +++ trunk/archipelago/tests/disco_benchmark.rb 2007-06-06 22:31:03 UTC (rev 322) @@ -9,12 +9,12 @@ x = 0 bm("Jockey#publish/lookup", :n => 10) do dj1.publish(Archipelago::Disco::Record.new({:service_id => x.to_s, :validator => Archipelago::Disco::MockValidator.new})) - assert(!dj2.lookup(Archipelago::Disco::Query.new({:service_id => x.to_s})).empty?) + assert(!dj2.lookup(Archipelago::Disco::Query.new({:service_id => x.to_s}), :timeout => 2).empty?) x += 1 end dj1.publish(Archipelago::Disco::Record.new({:service_id => "brappa", :validator => Archipelago::Disco::MockValidator.new})) bm("Jockey#lookup", :n => 10) do - assert(!dj2.lookup(Archipelago::Disco::Query.new({:service_id => "brappa"})).empty?) + assert(!dj2.lookup(Archipelago::Disco::Query.new({:service_id => "brappa"}), :timeout => 2).empty?) end end From nobody at rubyforge.org Wed Jun 6 18:31:45 2007 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 6 Jun 2007 18:31:45 -0400 (EDT) Subject: [Archipelago-submits] [323] trunk: bumped the version number Message-ID: <20070606223145.4390F5240B6F@rubyforge.org> Revision: 323 Author: zond Date: 2007-06-06 18:31:44 -0400 (Wed, 06 Jun 2007) Log Message: ----------- bumped the version number Modified Paths: -------------- trunk/archipelago/Rakefile trunk/hyperactive/README trunk/hyperactive/Rakefile trunk/oneliner/Rakefile trunk/rbtree-0.2.0/Rakefile Modified: trunk/archipelago/Rakefile =================================================================== --- trunk/archipelago/Rakefile 2007-06-06 22:31:03 UTC (rev 322) +++ trunk/archipelago/Rakefile 2007-06-06 22:31:44 UTC (rev 323) @@ -9,7 +9,7 @@ spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "archipelago" - s.version = "0.2.7" + s.version = "0.3.0" s.author = "Martin Kihlgren" s.email = "zond at troja dot ath dot cx" s.summary = "A set of tools for distributed computing in ruby." @@ -21,9 +21,9 @@ s.rdoc_options << '--line-numbers' s.rdoc_options << '--inline-source' s.extra_rdoc_files = ["README"] - s.add_dependency('oneliner', '>= 0.2.7') + s.add_dependency('oneliner', '>= 0.3.0') s.add_dependency('fastthread', '>= 1.0.0') - s.add_dependency('archipelago_rbtree', '>= 0.2.7') + s.add_dependency('archipelago_rbtree', '>= 0.3.0') end Modified: trunk/hyperactive/README =================================================================== --- trunk/hyperactive/README 2007-06-06 22:31:03 UTC (rev 322) +++ trunk/hyperactive/README 2007-06-06 22:31:44 UTC (rev 323) @@ -2,6 +2,9 @@ It uses archipelago for persistence, and is meaningful only in an environment where the server process doesnt restart at each request. This means that cgi environment is not really an option. +== Dependencies: +archipelago + == Sub packages: Hyperactive::Record:: The base class package itself, providing you with cached selectors and rejectors, along with cached finders for any number of attributes. Modified: trunk/hyperactive/Rakefile =================================================================== --- trunk/hyperactive/Rakefile 2007-06-06 22:31:03 UTC (rev 322) +++ trunk/hyperactive/Rakefile 2007-06-06 22:31:44 UTC (rev 323) @@ -9,7 +9,7 @@ spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "hyperactive" - s.version = "0.2.6" + s.version = "0.3.0" s.author = "Martin Kihlgren" s.email = "zond at troja dot ath dot cx" s.summary = "A base class for persistent objects that uses archipelago for persistence. Useful for Ruby on Rails models for example." @@ -21,7 +21,7 @@ s.rdoc_options << '--line-numbers' s.rdoc_options << '--inline-source' s.extra_rdoc_files = ["README"] - s.add_dependency('archipelago', '>= 0.2.0') + s.add_dependency('archipelago', '>= 0.3.0') end Modified: trunk/oneliner/Rakefile =================================================================== --- trunk/oneliner/Rakefile 2007-06-06 22:31:03 UTC (rev 322) +++ trunk/oneliner/Rakefile 2007-06-06 22:31:44 UTC (rev 323) @@ -9,7 +9,7 @@ spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "oneliner" - s.version = "0.2.7" + s.version = "0.3.0" s.author = "Martin Kihlgren" s.email = "zond at troja dot ath dot cx" s.summary = "An online code implementation for ruby." Modified: trunk/rbtree-0.2.0/Rakefile =================================================================== --- trunk/rbtree-0.2.0/Rakefile 2007-06-06 22:31:03 UTC (rev 322) +++ trunk/rbtree-0.2.0/Rakefile 2007-06-06 22:31:44 UTC (rev 323) @@ -9,7 +9,7 @@ spec = Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "archipelago_rbtree" - s.version = "0.2.7" + s.version = "0.3.0" s.author = "OZAWA Takuma, Kaz Kylheku, Martin Kihlgren" s.email = "zond at troja dot ath dot cx" s.summary = "A patched version of the rbtree code that accepts each and reverse_each with offsets." From nobody at rubyforge.org Wed Jun 6 18:33:10 2007 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 6 Jun 2007 18:33:10 -0400 (EDT) Subject: [Archipelago-submits] [324] tags/release_0_3_0/: made release_0_3_0 Message-ID: <20070606223310.4C7515240B6B@rubyforge.org> Revision: 324 Author: zond Date: 2007-06-06 18:33:09 -0400 (Wed, 06 Jun 2007) Log Message: ----------- made release_0_3_0 Added Paths: ----------- tags/release_0_3_0/ Copied: tags/release_0_3_0 (from rev 323, trunk)