X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2f3d49bde80526060d3337f13dfa91cd581ac222..20b2d6f7560e82add928fa14d868c9a4319d4907:/services/api/test/unit/node_test.rb diff --git a/services/api/test/unit/node_test.rb b/services/api/test/unit/node_test.rb index 5a9a057696..37e95db0e1 100644 --- a/services/api/test/unit/node_test.rb +++ b/services/api/test/unit/node_test.rb @@ -11,13 +11,19 @@ class NodeTest < ActiveSupport::TestCase test "pinging a node can add and update stats" do node = ping_node(:idle, {total_cpu_cores: '12', total_ram_mb: '512'}) - assert_equal(12, node.info['total_cpu_cores'].to_i) - assert_equal(512, node.info['total_ram_mb'].to_i) + assert_equal(12, node.properties['total_cpu_cores']) + assert_equal(512, node.properties['total_ram_mb']) end test "stats disappear if not in a ping" do node = ping_node(:idle, {total_ram_mb: '256'}) - refute_includes(node.info, 'total_cpu_cores') - assert_equal(256, node.info['total_ram_mb'].to_i) + refute_includes(node.properties, 'total_cpu_cores') + assert_equal(256, node.properties['total_ram_mb']) + end + + test "worker state is down for node with no slot" do + node = nodes(:was_idle_now_down) + assert_nil node.slot_number, "fixture is not what I expected" + assert_equal 'down', node.crunch_worker_state, "wrong worker state" end end