From 71f6ebd9a934be52876cd3a063cdb497b14f9cdf Mon Sep 17 00:00:00 2001 From: Robert Mosolgo Date: Thu, 24 Oct 2024 10:39:49 -0400 Subject: [PATCH] Update nonblocking dataloader tests --- spec/graphql/dataloader/nonblocking_dataloader_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/graphql/dataloader/nonblocking_dataloader_spec.rb b/spec/graphql/dataloader/nonblocking_dataloader_spec.rb index d2eceb1e6c..3e3aec77dc 100644 --- a/spec/graphql/dataloader/nonblocking_dataloader_spec.rb +++ b/spec/graphql/dataloader/nonblocking_dataloader_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" if Fiber.respond_to?(:scheduler) # Ruby 3+ - describe GraphQL::Dataloader::NonblockingDataloader do + describe "GraphQL::Dataloader::NonblockingDataloader" do class NonblockingSchema < GraphQL::Schema class SleepSource < GraphQL::Dataloader::Source def fetch(keys) @@ -84,7 +84,7 @@ def wait_for(tag:, wait:) end query(Query) - use GraphQL::Dataloader::NonblockingDataloader + use GraphQL::Dataloader, nonblocking: true end def with_scheduler @@ -99,7 +99,7 @@ def self.included(child_class) child_class.class_eval do it "runs IO in parallel by default" do - dataloader = GraphQL::Dataloader::NonblockingDataloader.new + dataloader = GraphQL::Dataloader.new(nonblocking: true) results = {} dataloader.append_job { sleep(0.1); results[:a] = 1 } dataloader.append_job { sleep(0.2); results[:b] = 2 } @@ -115,7 +115,7 @@ def self.included(child_class) end it "works with sources" do - dataloader = GraphQL::Dataloader::NonblockingDataloader.new + dataloader = GraphQL::Dataloader.new(nonblocking: true) r1 = dataloader.with(NonblockingSchema::SleepSource).request(0.1) r2 = dataloader.with(NonblockingSchema::SleepSource).request(0.2) r3 = dataloader.with(NonblockingSchema::SleepSource).request(0.3)