• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / mender / 2281564137

23 Jan 2026 10:59AM UTC coverage: 81.48% (+1.7%) from 79.764%
2281564137

push

gitlab-ci

michalkopczan
fix: Schedule next deployment poll if current one failed early causing no handler to be called

Ticket: MEN-9144
Changelog: Fix a hang when polling for deployment failed early causing no handler of API response
to be called. Added handler call for this case, causing the deployment polling
to continue.

Signed-off-by: Michal Kopczan <michal.kopczan@northern.tech>

1 of 1 new or added line in 1 file covered. (100.0%)

327 existing lines in 44 files now uncovered.

8839 of 10848 relevant lines covered (81.48%)

20226.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.87
/src/mender-update/standalone/states.hpp
1
// Copyright 2024 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14

15
#ifndef MENDER_UPDATE_STANDALONE_STATES_HPP
16
#define MENDER_UPDATE_STANDALONE_STATES_HPP
17

18
#include <common/state_machine.hpp>
19

20
#include <mender-update/standalone/context.hpp>
21
#include <mender-update/standalone/state_events.hpp>
22

23
namespace mender {
24
namespace update {
25
namespace standalone {
26

27
using namespace std;
28

29
namespace sm = mender::common::state_machine;
30

31
using StateType = sm::State<Context, StateEvent>;
32

33
class SaveState : virtual public StateType {
34
public:
35
        SaveState(const string &state) :
1,740✔
36
                state_ {state} {
870✔
37
        }
1,740✔
38
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override final;
39
        virtual void OnEnterSaveState(Context &ctx, sm::EventPoster<StateEvent> &poster) = 0;
40

41
private:
42
        string state_;
43
};
44

45
class JustSaveState : public SaveState {
46
public:
47
        JustSaveState(const string &state) :
1,566✔
48
                SaveState {state} {
783✔
49
        }
1,566✔
50
        void OnEnterSaveState(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
51
};
52

UNCOV
53
class PrepareDownloadState : virtual public StateType {
×
54
public:
55
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
56
};
57

UNCOV
58
class DownloadState : virtual public StateType {
×
59
public:
60
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
61
};
62

UNCOV
63
class ArtifactInstallState : virtual public StateType {
×
64
public:
65
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
66
};
67

68
class RebootAndRollbackQueryState : public SaveState {
69
public:
70
        RebootAndRollbackQueryState();
71
        void OnEnterSaveState(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
72
};
73

UNCOV
74
class ArtifactCommitState : virtual public StateType {
×
75
public:
76
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
77
};
78

UNCOV
79
class RollbackQueryState : virtual public StateType {
×
80
public:
81
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
82
};
83

UNCOV
84
class ArtifactRollbackState : virtual public StateType {
×
85
public:
86
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
87
};
88

UNCOV
89
class ArtifactFailureState : virtual public StateType {
×
90
public:
91
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
92
};
93

94
class CleanupState : virtual public StateType {
87✔
95
public:
96
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
97
};
98

UNCOV
99
class ScriptRunnerState : virtual public StateType {
×
100
public:
101
        ScriptRunnerState(
102
                executor::State state,
103
                executor::Action action,
104
                executor::OnError on_error,
105
                Result result_on_error) :
522✔
106
                state_ {state},
522✔
107
                action_ {action},
522✔
108
                on_error_ {on_error},
522✔
109
                result_on_error_ {result_on_error} {
348✔
110
        }
111

112
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
113

114
private:
115
        executor::State state_;
116
        executor::Action action_;
117
        executor::OnError on_error_;
118
        Result result_on_error_;
119
};
120

UNCOV
121
class ExitState : virtual public StateType {
×
122
public:
123
        ExitState(events::EventLoop &loop) :
87✔
124
                loop_ {loop} {
87✔
125
        }
126

127
        void OnEnter(Context &ctx, sm::EventPoster<StateEvent> &poster) override;
128

129
private:
130
        events::EventLoop &loop_;
131
};
132

133
} // namespace standalone
134
} // namespace update
135
} // namespace mender
136

137
#endif // MENDER_UPDATE_STANDALONE_STATES_HPP
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc