Stephan Pleines | bad7007 | 2024-05-22 16:48:01 -0700 | [diff] [blame] | 1 | #include <stdint.h> |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 2 | |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame] | 3 | #include <chrono> |
Stephan Pleines | bad7007 | 2024-05-22 16:48:01 -0700 | [diff] [blame] | 4 | #include <functional> |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 5 | #include <memory> |
Stephan Pleines | bad7007 | 2024-05-22 16:48:01 -0700 | [diff] [blame] | 6 | #include <ostream> |
| 7 | #include <string> |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 8 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 9 | #include "absl/log/check.h" |
| 10 | #include "absl/log/log.h" |
Stephan Pleines | bad7007 | 2024-05-22 16:48:01 -0700 | [diff] [blame] | 11 | #include "flatbuffers/buffer.h" |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 12 | #include "gtest/gtest.h" |
| 13 | |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 14 | #include "aos/actions/actions.h" |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 15 | #include "aos/actions/actions_generated.h" |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 16 | #include "aos/actions/actor.h" |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 17 | #include "aos/actions/test_action_generated.h" |
Stephan Pleines | bad7007 | 2024-05-22 16:48:01 -0700 | [diff] [blame] | 18 | #include "aos/configuration.h" |
| 19 | #include "aos/events/event_loop.h" |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 20 | #include "aos/events/simulated_event_loop.h" |
Stephan Pleines | bad7007 | 2024-05-22 16:48:01 -0700 | [diff] [blame] | 21 | #include "aos/flatbuffers.h" |
| 22 | #include "aos/json_to_flatbuffer.h" |
| 23 | #include "aos/logging/implementations.h" |
Austin Schuh | 373f176 | 2021-06-02 21:07:09 -0700 | [diff] [blame] | 24 | #include "aos/testing/path.h" |
Stephan Pleines | bad7007 | 2024-05-22 16:48:01 -0700 | [diff] [blame] | 25 | #include "aos/time/time.h" |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 26 | |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 27 | namespace aos::common::actions::testing { |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 28 | |
Austin Schuh | f2a50ba | 2016-12-24 16:16:26 -0800 | [diff] [blame] | 29 | namespace chrono = ::std::chrono; |
| 30 | |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 31 | class TestActorIndex |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 32 | : public aos::common::actions::ActorBase<actions::TestActionGoal> { |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 33 | public: |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 34 | typedef TypedActionFactory<actions::TestActionGoal> Factory; |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 35 | |
| 36 | explicit TestActorIndex(::aos::EventLoop *event_loop) |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 37 | : aos::common::actions::ActorBase<actions::TestActionGoal>( |
| 38 | event_loop, "/test_action") {} |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 39 | |
| 40 | static Factory MakeFactory(::aos::EventLoop *event_loop) { |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 41 | return Factory(event_loop, "/test_action"); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 42 | } |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 43 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 44 | bool RunAction(const UInt *new_index) override { |
| 45 | VLOG(1) << "New index " << FlatbufferToJson(new_index); |
| 46 | index = new_index->val(); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 47 | return true; |
| 48 | } |
| 49 | |
| 50 | uint32_t index = 0; |
| 51 | }; |
| 52 | |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 53 | class TestActorNOP |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 54 | : public aos::common::actions::ActorBase<actions::TestActionGoal> { |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 55 | public: |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 56 | typedef TypedActionFactory<actions::TestActionGoal> Factory; |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 57 | |
| 58 | explicit TestActorNOP(::aos::EventLoop *event_loop) |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame] | 59 | : actions::ActorBase<actions::TestActionGoal>(event_loop, |
| 60 | "/test_action") {} |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 61 | |
| 62 | static Factory MakeFactory(::aos::EventLoop *event_loop) { |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 63 | return Factory(event_loop, "/test_action"); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 64 | } |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 65 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 66 | bool RunAction(const UInt *) override { return true; } |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 67 | }; |
| 68 | |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 69 | class TestActorShouldCancel |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 70 | : public aos::common::actions::ActorBase<actions::TestActionGoal> { |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 71 | public: |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 72 | typedef TypedActionFactory<actions::TestActionGoal> Factory; |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 73 | |
| 74 | explicit TestActorShouldCancel(::aos::EventLoop *event_loop) |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 75 | : aos::common::actions::ActorBase<actions::TestActionGoal>( |
| 76 | event_loop, "/test_action") {} |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 77 | |
| 78 | static Factory MakeFactory(::aos::EventLoop *event_loop) { |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 79 | return Factory(event_loop, "/test_action"); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 80 | } |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 81 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 82 | bool RunAction(const UInt *) override { |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 83 | while (!ShouldCancel()) { |
Austin Schuh | f257f3c | 2019-10-27 21:00:43 -0700 | [diff] [blame] | 84 | AOS_LOG(FATAL, "NOT CANCELED!!\n"); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 85 | } |
Daniel Petti | 3b1e48f | 2015-02-15 15:57:53 -0800 | [diff] [blame] | 86 | return true; |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 87 | } |
| 88 | }; |
| 89 | |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 90 | class TestActor2Nop |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 91 | : public aos::common::actions::ActorBase<actions::TestAction2Goal> { |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 92 | public: |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 93 | typedef TypedActionFactory<actions::TestAction2Goal> Factory; |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 94 | |
| 95 | explicit TestActor2Nop(::aos::EventLoop *event_loop) |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame] | 96 | : actions::ActorBase<actions::TestAction2Goal>(event_loop, |
| 97 | "/test_action2") {} |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 98 | |
| 99 | static Factory MakeFactory(::aos::EventLoop *event_loop) { |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 100 | return Factory(event_loop, "/test_action2"); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 101 | } |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 102 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 103 | bool RunAction(const actions::MyParams *) { return true; } |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 104 | }; |
| 105 | |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 106 | class ActionTest : public ::testing::Test { |
| 107 | protected: |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 108 | ActionTest() |
Austin Schuh | 373f176 | 2021-06-02 21:07:09 -0700 | [diff] [blame] | 109 | : configuration_(configuration::ReadConfig( |
| 110 | aos::testing::ArtifactPath("aos/actions/action_test_config.json"))), |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 111 | event_loop_factory_(&configuration_.message()), |
Austin Schuh | 5f1cc5c | 2019-12-01 18:01:11 -0800 | [diff] [blame] | 112 | actor1_event_loop_(event_loop_factory_.MakeEventLoop("actor1")), |
| 113 | actor2_event_loop_(event_loop_factory_.MakeEventLoop("actor2")), |
Brian Silverman | 13065ed | 2020-12-16 15:15:27 -0800 | [diff] [blame] | 114 | test_event_loop_(event_loop_factory_.MakeEventLoop("test")) {} |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 115 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 116 | void RunAt(monotonic_clock::time_point exec_time, std::function<void()> fn) { |
| 117 | TimerHandler *timer = test_event_loop_->AddTimer(fn); |
Philipp Schrader | a671252 | 2023-07-05 20:25:11 -0700 | [diff] [blame] | 118 | test_event_loop_->OnRun( |
| 119 | [timer, exec_time]() { timer->Schedule(exec_time); }); |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 120 | } |
| 121 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 122 | FlatbufferDetachedBuffer<Configuration> configuration_; |
| 123 | |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 124 | // Bring up and down Core. |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 125 | ::aos::SimulatedEventLoopFactory event_loop_factory_; |
| 126 | |
| 127 | ::std::unique_ptr<::aos::EventLoop> actor1_event_loop_; |
| 128 | ::std::unique_ptr<::aos::EventLoop> actor2_event_loop_; |
| 129 | ::std::unique_ptr<::aos::EventLoop> test_event_loop_; |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 130 | }; |
| 131 | |
| 132 | // Tests that the the actions exist in a safe state at startup. |
| 133 | TEST_F(ActionTest, DoesNothing) { |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 134 | ActionQueue action_queue; |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 135 | // Tick an empty queue and make sure it was not running. |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 136 | EXPECT_FALSE(action_queue.Running()); |
| 137 | action_queue.Tick(); |
| 138 | EXPECT_FALSE(action_queue.Running()); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 139 | } |
| 140 | |
Brian Silverman | a2ae62d | 2015-03-15 15:55:22 -0700 | [diff] [blame] | 141 | // Tests that starting with an old run message in the goal queue actually works. |
| 142 | // This used to result in the client hanging, waiting for a response to its |
| 143 | // cancel message. |
| 144 | TEST_F(ActionTest, StartWithOldGoal) { |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 145 | ::std::unique_ptr<::aos::EventLoop> test2_event_loop = |
Austin Schuh | 5f1cc5c | 2019-12-01 18:01:11 -0800 | [diff] [blame] | 146 | event_loop_factory_.MakeEventLoop("test2"); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 147 | ::aos::Sender<TestActionGoal> goal_sender = |
| 148 | test2_event_loop->MakeSender<TestActionGoal>("/test_action"); |
| 149 | ::aos::Fetcher<Status> status_fetcher = |
| 150 | test2_event_loop->MakeFetcher<Status>("/test_action"); |
Brian Silverman | a2ae62d | 2015-03-15 15:55:22 -0700 | [diff] [blame] | 151 | |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 152 | TestActorIndex::Factory nop_actor_factory = |
| 153 | TestActorNOP::MakeFactory(test_event_loop_.get()); |
Brian Silverman | a2ae62d | 2015-03-15 15:55:22 -0700 | [diff] [blame] | 154 | |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 155 | ActionQueue action_queue; |
Brian Silverman | a2ae62d | 2015-03-15 15:55:22 -0700 | [diff] [blame] | 156 | |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 157 | { |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame] | 158 | ::aos::Sender<TestActionGoal>::Builder builder = goal_sender.MakeBuilder(); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 159 | |
| 160 | TestActionGoal::Builder goal_builder = |
| 161 | builder.MakeBuilder<TestActionGoal>(); |
| 162 | |
| 163 | goal_builder.add_run(971); |
milind | 1f1dca3 | 2021-07-03 13:50:07 -0700 | [diff] [blame] | 164 | builder.CheckOk(builder.Send(goal_builder.Finish())); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 165 | } |
| 166 | |
| 167 | TestActorNOP nop_act(actor1_event_loop_.get()); |
| 168 | |
| 169 | ASSERT_FALSE(status_fetcher.Fetch()); |
| 170 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 171 | RunAt(monotonic_clock::time_point(chrono::seconds(1)), [&]() { |
| 172 | ASSERT_TRUE(status_fetcher.Fetch()); |
| 173 | EXPECT_EQ(0u, status_fetcher->running()); |
| 174 | EXPECT_EQ(0u, status_fetcher->last_running()); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 175 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 176 | { |
| 177 | UIntT uint; |
| 178 | uint.val = 0; |
| 179 | action_queue.EnqueueAction(nop_actor_factory.Make(uint)); |
| 180 | } |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 181 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 182 | // We started an action and it should be running. |
| 183 | EXPECT_TRUE(action_queue.Running()); |
Brian Silverman | a2ae62d | 2015-03-15 15:55:22 -0700 | [diff] [blame] | 184 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 185 | action_queue.CancelAllActions(); |
| 186 | action_queue.Tick(); |
Brian Silverman | a2ae62d | 2015-03-15 15:55:22 -0700 | [diff] [blame] | 187 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 188 | EXPECT_TRUE(action_queue.Running()); |
| 189 | }); |
Brian Silverman | a2ae62d | 2015-03-15 15:55:22 -0700 | [diff] [blame] | 190 | |
| 191 | // Run the action so it can signal completion. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 192 | RunAt(monotonic_clock::time_point(chrono::seconds(2)), [&]() { |
| 193 | action_queue.Tick(); |
Brian Silverman | a2ae62d | 2015-03-15 15:55:22 -0700 | [diff] [blame] | 194 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 195 | // Make sure it stopped. |
| 196 | EXPECT_FALSE(action_queue.Running()); |
| 197 | }); |
| 198 | |
| 199 | event_loop_factory_.RunFor(chrono::seconds(3)); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | // Tests that an action starts and stops. |
| 203 | TEST_F(ActionTest, ActionQueueWasRunning) { |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 204 | TestActorNOP nop_act(actor1_event_loop_.get()); |
| 205 | |
| 206 | TestActorIndex::Factory nop_actor_factory = |
| 207 | TestActorNOP::MakeFactory(test_event_loop_.get()); |
| 208 | |
| 209 | ActionQueue action_queue; |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 210 | |
| 211 | // Tick an empty queue and make sure it was not running. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 212 | RunAt(monotonic_clock::time_point(chrono::seconds(1)), [&]() { |
| 213 | action_queue.Tick(); |
| 214 | EXPECT_FALSE(action_queue.Running()); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 215 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 216 | { |
| 217 | UIntT uint; |
| 218 | uint.val = 0; |
| 219 | action_queue.EnqueueAction(nop_actor_factory.Make(uint)); |
| 220 | } |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 221 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 222 | // We started an action and it should be running. |
| 223 | EXPECT_TRUE(action_queue.Running()); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 224 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 225 | // Tick it and make sure it is still running. |
| 226 | action_queue.Tick(); |
| 227 | EXPECT_TRUE(action_queue.Running()); |
| 228 | }); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 229 | |
| 230 | // Run the action so it can signal completion. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 231 | RunAt(monotonic_clock::time_point(chrono::seconds(2)), [&]() { |
| 232 | action_queue.Tick(); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 233 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 234 | // Make sure it stopped. |
| 235 | EXPECT_FALSE(action_queue.Running()); |
| 236 | }); |
| 237 | |
| 238 | event_loop_factory_.RunFor(chrono::seconds(3)); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | // Tests that we can cancel two actions and have them both stop. |
| 242 | TEST_F(ActionTest, ActionQueueCancelAll) { |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 243 | TestActorNOP nop_act(actor1_event_loop_.get()); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 244 | |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 245 | TestActorIndex::Factory nop_actor_factory = |
| 246 | TestActorNOP::MakeFactory(test_event_loop_.get()); |
| 247 | |
| 248 | ActionQueue action_queue; |
| 249 | |
| 250 | // Let the actor and action queue start up and confirm nothing is running. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 251 | RunAt(monotonic_clock::time_point(chrono::seconds(1)), [&]() { |
| 252 | action_queue.Tick(); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 253 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 254 | EXPECT_FALSE(action_queue.Running()); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 255 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 256 | // Enqueue two actions to test both cancel. We can have an action and a next |
| 257 | // action so we want to test that. |
| 258 | { |
| 259 | UIntT uint; |
| 260 | uint.val = 0; |
| 261 | action_queue.EnqueueAction(nop_actor_factory.Make(uint)); |
| 262 | action_queue.EnqueueAction(nop_actor_factory.Make(uint)); |
| 263 | } |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 264 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 265 | action_queue.Tick(); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 266 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 267 | // Check that current and next exist. |
| 268 | EXPECT_TRUE(action_queue.GetCurrentActionState(nullptr, nullptr, nullptr, |
| 269 | nullptr, nullptr, nullptr)); |
| 270 | EXPECT_TRUE(action_queue.GetNextActionState(nullptr, nullptr, nullptr, |
| 271 | nullptr, nullptr, nullptr)); |
| 272 | |
| 273 | action_queue.CancelAllActions(); |
| 274 | action_queue.Tick(); |
| 275 | |
| 276 | // It should still be running as the actor could not have signaled. |
| 277 | EXPECT_TRUE(action_queue.Running()); |
| 278 | |
| 279 | bool sent_started, sent_cancel, interrupted; |
| 280 | EXPECT_TRUE(action_queue.GetCurrentActionState( |
| 281 | nullptr, &sent_started, &sent_cancel, &interrupted, nullptr, nullptr)); |
| 282 | EXPECT_TRUE(sent_started); |
| 283 | EXPECT_TRUE(sent_cancel); |
| 284 | EXPECT_FALSE(interrupted); |
| 285 | |
| 286 | EXPECT_FALSE(action_queue.GetNextActionState(nullptr, nullptr, nullptr, |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 287 | nullptr, nullptr, nullptr)); |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 288 | }); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 289 | |
| 290 | // Run the action so it can signal completion. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 291 | RunAt(monotonic_clock::time_point(chrono::seconds(2)), [&]() { |
| 292 | action_queue.Tick(); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 293 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 294 | // Make sure it stopped. |
| 295 | EXPECT_FALSE(action_queue.Running()); |
| 296 | EXPECT_EQ(1, nop_act.running_count()); |
| 297 | }); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 298 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 299 | event_loop_factory_.RunFor(chrono::seconds(3)); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 300 | } |
| 301 | |
| 302 | // Tests that an action that would block forever stops when canceled. |
| 303 | TEST_F(ActionTest, ActionQueueCancelOne) { |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 304 | TestActorShouldCancel cancel_act(actor1_event_loop_.get()); |
| 305 | |
| 306 | TestActorShouldCancel::Factory cancel_action_factory = |
| 307 | TestActorShouldCancel::MakeFactory(test_event_loop_.get()); |
| 308 | |
| 309 | ActionQueue action_queue; |
| 310 | |
| 311 | // Let the actor and action queue start up. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 312 | RunAt(monotonic_clock::time_point(chrono::seconds(1)), [&]() { |
| 313 | action_queue.Tick(); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 314 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 315 | // Enqueue blocking action. |
| 316 | { |
| 317 | UIntT uint; |
| 318 | uint.val = 0; |
| 319 | action_queue.EnqueueAction(cancel_action_factory.Make(uint)); |
| 320 | } |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 321 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 322 | action_queue.Tick(); |
| 323 | EXPECT_TRUE(action_queue.Running()); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 324 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 325 | // Tell action to cancel. |
| 326 | action_queue.CancelCurrentAction(); |
| 327 | action_queue.Tick(); |
| 328 | }); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 329 | |
| 330 | // This will block forever on failure. |
| 331 | // TODO(ben): prolly a bad way to fail |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 332 | RunAt(monotonic_clock::time_point(chrono::seconds(2)), [&]() { |
| 333 | action_queue.Tick(); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 334 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 335 | // It should still be running as the actor could not have signalled. |
| 336 | EXPECT_FALSE(action_queue.Running()); |
| 337 | }); |
| 338 | |
| 339 | event_loop_factory_.RunFor(chrono::seconds(3)); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 340 | } |
| 341 | |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 342 | // Tests that 2 actions in a row causes the second one to cancel the first one. |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 343 | TEST_F(ActionTest, ActionQueueTwoActions) { |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 344 | TestActorNOP nop_actor(actor1_event_loop_.get()); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 345 | |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 346 | TestActorIndex::Factory nop_actor_factory = |
| 347 | TestActorNOP::MakeFactory(test_event_loop_.get()); |
| 348 | |
| 349 | ActionQueue action_queue; |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 350 | |
| 351 | // id for the first time run. |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 352 | uint32_t nop_actor_id = 0; |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 353 | // Check the internal state and write down id for later use. |
| 354 | bool sent_started, sent_cancel, interrupted; |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 355 | // id for the second run. |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 356 | uint32_t nop_actor2_id = 0; |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 357 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 358 | // Tick an empty queue and make sure it was not running. |
| 359 | RunAt(monotonic_clock::time_point(chrono::seconds(1)), [&]() { |
| 360 | action_queue.Tick(); |
| 361 | EXPECT_FALSE(action_queue.Running()); |
| 362 | |
| 363 | // Enqueue action to be canceled. |
| 364 | { |
| 365 | UIntT uint; |
| 366 | uint.val = 0; |
| 367 | action_queue.EnqueueAction(nop_actor_factory.Make(uint)); |
| 368 | } |
| 369 | action_queue.Tick(); |
| 370 | |
| 371 | // Should still be running as the actor could not have signalled. |
| 372 | EXPECT_TRUE(action_queue.Running()); |
| 373 | |
| 374 | EXPECT_TRUE(action_queue.GetCurrentActionState(nullptr, &sent_started, |
| 375 | &sent_cancel, &interrupted, |
| 376 | &nop_actor_id, nullptr)); |
| 377 | EXPECT_TRUE(sent_started); |
| 378 | EXPECT_FALSE(sent_cancel); |
| 379 | EXPECT_FALSE(interrupted); |
| 380 | ASSERT_NE(0u, nop_actor_id); |
| 381 | |
| 382 | // Add the next action which should ensure the first stopped. |
| 383 | { |
| 384 | UIntT uint; |
| 385 | uint.val = 0; |
| 386 | action_queue.EnqueueAction(nop_actor_factory.Make(uint)); |
| 387 | } |
| 388 | |
| 389 | // Check the internal state and write down id for later use. |
| 390 | EXPECT_TRUE(action_queue.GetNextActionState(nullptr, &sent_started, |
| 391 | &sent_cancel, &interrupted, |
| 392 | &nop_actor2_id, nullptr)); |
| 393 | EXPECT_NE(nop_actor_id, nop_actor2_id); |
| 394 | EXPECT_FALSE(sent_started); |
| 395 | EXPECT_FALSE(sent_cancel); |
| 396 | EXPECT_FALSE(interrupted); |
| 397 | ASSERT_NE(0u, nop_actor2_id); |
| 398 | |
| 399 | action_queue.Tick(); |
| 400 | }); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 401 | |
| 402 | // Run the action so it can signal completion. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 403 | RunAt(monotonic_clock::time_point(chrono::seconds(2)), [&]() { |
| 404 | action_queue.Tick(); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 405 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 406 | // Check the new action is the right one. |
| 407 | uint32_t test_id = 0; |
| 408 | EXPECT_TRUE(action_queue.GetCurrentActionState( |
| 409 | nullptr, &sent_started, &sent_cancel, &interrupted, &test_id, nullptr)); |
| 410 | EXPECT_TRUE(sent_started); |
| 411 | EXPECT_FALSE(sent_cancel); |
| 412 | EXPECT_FALSE(interrupted); |
| 413 | EXPECT_EQ(nop_actor2_id, test_id); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 414 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 415 | // Make sure it is still going. |
| 416 | EXPECT_TRUE(action_queue.Running()); |
| 417 | }); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 418 | |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 419 | // Now let everything finish. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 420 | RunAt(monotonic_clock::time_point(chrono::seconds(3)), [&]() { |
| 421 | action_queue.Tick(); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 422 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 423 | // Make sure it stopped. |
| 424 | EXPECT_FALSE(action_queue.Running()); |
| 425 | }); |
| 426 | |
| 427 | event_loop_factory_.RunFor(chrono::seconds(4)); |
Ben Fredrickson | d69f38b | 2015-01-28 20:06:15 -0800 | [diff] [blame] | 428 | } |
| 429 | |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 430 | // Tests that we do get an index with our goal |
| 431 | TEST_F(ActionTest, ActionIndex) { |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 432 | TestActorIndex idx_actor(actor1_event_loop_.get()); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 433 | |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 434 | TestActorIndex::Factory test_actor_index_factory = |
| 435 | TestActorIndex::MakeFactory(test_event_loop_.get()); |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 436 | ::aos::Fetcher<actions::TestActionGoal> goal_fetcher_ = |
| 437 | test_event_loop_->MakeFetcher<actions::TestActionGoal>("/test_action"); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 438 | |
| 439 | ActionQueue action_queue; |
| 440 | // Tick an empty queue and make sure it was not running. Also tick the |
| 441 | // factory to allow it to send out the initial cancel message. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 442 | RunAt(monotonic_clock::time_point(chrono::seconds(1)), [&]() { |
| 443 | action_queue.Tick(); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 444 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 445 | EXPECT_FALSE(action_queue.Running()); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 446 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 447 | // Enqueue action to post index. |
| 448 | { |
| 449 | UIntT uint; |
| 450 | uint.val = 5; |
| 451 | action_queue.EnqueueAction(test_actor_index_factory.Make(uint)); |
| 452 | } |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 453 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 454 | ASSERT_TRUE(goal_fetcher_.Fetch()); |
| 455 | EXPECT_EQ(5u, goal_fetcher_->params()->val()); |
| 456 | EXPECT_EQ(0u, idx_actor.index); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 457 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 458 | action_queue.Tick(); |
| 459 | }); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 460 | |
| 461 | // Run the next action so it can accomplish signal completion. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 462 | RunAt(monotonic_clock::time_point(chrono::seconds(2)), [&]() { |
| 463 | action_queue.Tick(); |
| 464 | EXPECT_EQ(5u, idx_actor.index); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 465 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 466 | // Enqueue action to post index. |
| 467 | { |
| 468 | UIntT uint; |
| 469 | uint.val = 3; |
| 470 | action_queue.EnqueueAction(test_actor_index_factory.Make(uint)); |
| 471 | } |
| 472 | ASSERT_TRUE(goal_fetcher_.Fetch()); |
| 473 | EXPECT_EQ(3u, goal_fetcher_->params()->val()); |
| 474 | }); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 475 | |
| 476 | // Run the next action so it can accomplish signal completion. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 477 | RunAt(monotonic_clock::time_point(chrono::seconds(3)), [&]() { |
| 478 | action_queue.Tick(); |
| 479 | EXPECT_EQ(3u, idx_actor.index); |
| 480 | }); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 481 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 482 | event_loop_factory_.RunFor(chrono::seconds(3)); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 483 | } |
| 484 | |
| 485 | // Tests that an action with a structure params works. |
| 486 | TEST_F(ActionTest, StructParamType) { |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 487 | TestActor2Nop nop_actor(actor2_event_loop_.get()); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 488 | |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 489 | TestActor2Nop::Factory test_action_2_nop_factory = |
| 490 | TestActor2Nop::MakeFactory(test_event_loop_.get()); |
| 491 | |
| 492 | ActionQueue action_queue; |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 493 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 494 | RunAt(monotonic_clock::time_point(chrono::seconds(0)), [&]() { |
| 495 | // Tick an empty queue and make sure it was not running. |
| 496 | action_queue.Tick(); |
| 497 | EXPECT_FALSE(action_queue.Running()); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 498 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 499 | actions::MyParamsT p; |
| 500 | p.param1 = 5.0; |
| 501 | p.param2 = 7; |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 502 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 503 | action_queue.EnqueueAction(test_action_2_nop_factory.Make(p)); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 504 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 505 | // We started an action and it should be running. |
| 506 | EXPECT_TRUE(action_queue.Running()); |
| 507 | |
| 508 | // Tick it and make sure it is still running. |
| 509 | action_queue.Tick(); |
| 510 | EXPECT_TRUE(action_queue.Running()); |
| 511 | }); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 512 | |
| 513 | // Run the action so it can signal completion. |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 514 | // The actor takes no time, but running for a second is the best way to get it |
| 515 | // to go. |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 516 | RunAt(monotonic_clock::time_point(chrono::seconds(1)), [&]() { |
| 517 | action_queue.Tick(); |
Austin Schuh | 1bf8a21 | 2019-05-26 22:13:14 -0700 | [diff] [blame] | 518 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 519 | // Make sure it stopped. |
| 520 | EXPECT_FALSE(action_queue.Running()); |
| 521 | }); |
Ben Fredrickson | 9fb2ab1 | 2015-02-16 16:42:08 -0800 | [diff] [blame] | 522 | |
Austin Schuh | 02e2aeb | 2020-02-10 21:51:30 -0800 | [diff] [blame] | 523 | event_loop_factory_.RunFor(chrono::seconds(2)); |
Brian Silverman | 237a554 | 2015-03-29 17:59:29 -0400 | [diff] [blame] | 524 | } |
| 525 | |
Stephan Pleines | f63bde8 | 2024-01-13 15:59:33 -0800 | [diff] [blame] | 526 | } // namespace aos::common::actions::testing |