Skip to content

Commit 3a3e4d9

Browse files
committed
test: remove sleeps
1 parent 81b99e7 commit 3a3e4d9

File tree

11 files changed

+17
-28
lines changed

11 files changed

+17
-28
lines changed

drivers/cisco/meraki/meraki_locations_spec.cr

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ DriverSpecs.mock_driver "Cisco::Meraki::Locations" do
1919
Dashboard: {DashboardMock},
2020
})
2121

22-
sleep 0.5
23-
2422
# Should standardise the format of MAC addresses
2523
exec(:format_mac, "0x12:34:A6-789B").get.should eq %(1234a6789b)
2624

drivers/cisco/switch/snooping_catalyst_spec.cr

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ require "placeos-driver/spec"
22

33
DriverSpecs.mock_driver "Cisco::Switch::SnoopingCatalyst" do
44
transmit "SG-MARWFA61301>"
5-
sleep 1.5.seconds
65

76
should_send "show interfaces status\n"
87
transmit "show interfaces status\n"
@@ -30,8 +29,6 @@ Te4/1/4 connected trunk full 10G SFP-10GBase-S
3029
Po1 connected trunk a-full a-10G
3130
)
3231

33-
sleep 3.1.seconds
34-
3532
should_send "show mac address-table\n"
3633
transmit "show mac address-table\n"
3734

@@ -40,8 +37,6 @@ Po1 connected trunk a-full a-10G
4037
10 f4db.e618.10a4 DYNAMIC Te2/0/40
4138
)
4239

43-
sleep 3.1.seconds
44-
4540
should_send "show ip dhcp snooping binding\n"
4641
transmit %(MacAddress IpAddress Lease(sec) Type VLAN Interface
4742
------------------ --------------- ---------- ------------- ---- --------------------

drivers/denon/amplifier/av_receiver_spec.cr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ DriverSpecs.mock_driver "Denon::Amplifier::AvReceiver" do
44
####
55
# POWER
66
#
7-
sleep 1.second
7+
88
# query power
99
exec(:power?)
1010
should_send("PW?")
@@ -24,7 +24,7 @@ DriverSpecs.mock_driver "Denon::Amplifier::AvReceiver" do
2424
####
2525
# INPUT
2626
#
27-
sleep 1.second
27+
2828
# query input > DVD
2929
exec(:input?)
3030
should_send("SI?")
@@ -39,7 +39,7 @@ DriverSpecs.mock_driver "Denon::Amplifier::AvReceiver" do
3939
####
4040
# VOLUME
4141
#
42-
sleep 1.second
42+
4343
# query
4444
exec(:volume?)
4545
should_send("MV?")
@@ -54,7 +54,7 @@ DriverSpecs.mock_driver "Denon::Amplifier::AvReceiver" do
5454
####
5555
# MUTE
5656
#
57-
sleep 1.second
57+
5858
# query
5959
exec(:mute?)
6060
should_send("MU?")

drivers/exterity/avedia_player/r92xx_spec.cr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ DriverSpecs.mock_driver "Exterity::AvediaPlayer::R92xx" do
1010

1111
status[:ready].should eq(false)
1212
responds("Exterity Control Interface\r")
13-
sleep(2)
13+
1414
status[:ready].should eq(true)
1515

1616
exec(:version)
1717
responds("^SoftwareVersion:123!\r")
18-
sleep(2)
18+
1919
status[:version].should eq("123")
2020

2121
exec(:tv_info)
2222
responds("^tv_info:a,b,c,d,e,f,g!\r")
23-
sleep(2)
23+
2424
status[:tv_info].should eq("a,b,c,d,e,f,g")
2525
end

drivers/exterity/avedia_player/r93xx_spec.cr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ DriverSpecs.mock_driver "Exterity::AvediaPlayer::R92xx" do
88
# this lets the driver know it's successfully connected
99
status[:ready].should eq(false)
1010
responds("Terminal Control Interface\r")
11-
sleep(2)
11+
1212
status[:ready].should eq(true)
1313

1414
exec(:version)
1515
responds("^SoftwareVersion:123!\r")
16-
sleep(2)
16+
1717
status[:version].should eq("123")
1818

1919
exec(:tv_info)
2020
responds("^tv_info:a,b,c,d,e,f,g!\r")
21-
sleep(2)
21+
2222
status[:tv_info].should eq("a,b,c,d,e,f,g")
2323
end

drivers/global_cache/gc_100_spec.cr

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ DriverSpecs.mock_driver "GlobalCache::Gc100" do
1010
responds("endlistdevices\r")
1111
should_send("get_NET,0:1\r")
1212

13-
sleep 1
14-
1513
status[:relay_config].should eq({
1614
"relay" => {"0" => "2:1", "1" => "2:2", "2" => "2:3"},
1715
"relaysensor" => {"0" => "1:1", "1" => "1:2", "2" => "1:3", "3" => "1:4"},

drivers/panasonic/display/protocol2_spec.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ DriverSpecs.mock_driver "Panasonic::Display::Protocol2" do
1919
responds("NTCONTROL 1 09b075be\r")
2020
should_send("#{password}00PON\r")
2121
responds("00PON\r")
22-
sleep 8.seconds
22+
2323
expect_reconnect
2424
responds("NTCONTROL 1 09b075be\r")
2525
should_send("#{password}00QPW\r")
@@ -66,7 +66,7 @@ DriverSpecs.mock_driver "Panasonic::Display::Protocol2" do
6666
responds("NTCONTROL 1 09b075be\r")
6767
should_send("#{password}00POF\r")
6868
responds("00POF\r")
69-
sleep 8.seconds
69+
7070
expect_reconnect
7171
responds("NTCONTROL 1 09b075be\r")
7272
should_send("#{password}00QPW\r")

drivers/place/mqtt_spec.cr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ DriverSpecs.mock_driver "Place::MQTT" do
5151
publish.packet_length = publish.calculate_length
5252

5353
transmit publish.to_slice
54-
sleep 0.1 # wait a bit for processing
5554
status["root/topic"].should eq("testing")
5655

5756
# ============================

drivers/screen_technics/connect_spec.cr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ DriverSpecs.mock_driver "ScreenTechnics::Connect" do
3131
# * stop command
3232
# * down command
3333
# * status request
34-
sleep 1.second
34+
3535
should_send("36, 19\r\n", timeout: 1.second)
3636
responds("136, 1, 19\r\n")
3737

@@ -41,7 +41,6 @@ DriverSpecs.mock_driver "ScreenTechnics::Connect" do
4141
# Execute the emergency stop and request another down request
4242
exec(:stop, index: 2, emergency: true) do |response|
4343
exec(:move, "Down", 2)
44-
sleep 500.milliseconds
4544

4645
# --> respond to the down command
4746
responds("133, 1, 19, 1\r\n")

drivers/sharp/pn_series_spec.cr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ DriverSpecs.mock_driver "Sharp::PnSeries" do
1515
})
1616

1717
# Retrying send_credentials
18-
sleep 5
1918
should_send("user\x0D\x0A")
2019
responds("OK\x0D\x0A")
2120
should_send("pass\x0D\x0A")
@@ -43,7 +42,7 @@ DriverSpecs.mock_driver "Sharp::PnSeries" do
4342
should_send("INPS0010\x0D\x0A")
4443
responds("WAIT\x0D\x0A")
4544
responds("OK\x0D\x0A")
46-
sleep 2
45+
4746
should_send("INPS????\x0D\x0A")
4847
responds("INPS 10\x0D\x0A")
4948
status[:input].should eq("HDMI")

0 commit comments

Comments
 (0)