From 2c1a1d8c32df283ebf2899a34b42f7098143c82a Mon Sep 17 00:00:00 2001 From: Tobias Schottdorf Date: Wed, 14 Aug 2019 17:27:17 +0200 Subject: [PATCH] rafttest: add _breakpoint directive It is a helper case to attach a debugger to when a problem needs to be investigated in a longer test file. In such a case, add the following stanza immediately before the interesting behavior starts: _breakpoint: ---- ok and set a breakpoint on the _breakpoint case. --- raft/rafttest/interaction_env_handler.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/raft/rafttest/interaction_env_handler.go b/raft/rafttest/interaction_env_handler.go index a6e51d372..145cdbe94 100644 --- a/raft/rafttest/interaction_env_handler.go +++ b/raft/rafttest/interaction_env_handler.go @@ -30,6 +30,16 @@ func (env *InteractionEnv) Handle(t *testing.T, d datadriven.TestData) string { env.Output.Reset() var err error switch d.Cmd { + case "_breakpoint": + // This is a helper case to attach a debugger to when a problem needs + // to be investigated in a longer test file. In such a case, add the + // following stanza immediately before the interesting behavior starts: + // + // _breakpoint: + // ---- + // ok + // + // and set a breakpoint on the `case` above. case "add-nodes": // Example: //