Commit Graph

8 Commits

Author SHA1 Message Date
Kamil Braun
8d4dd53c25 test: raft: logical_timer: add abortable version of sleep_until
`sleep_until(time_point tp, abort_source& as)` will sleep until `tp`, or
until `as.request_abort()` is called, whatever comes first.
2022-03-29 15:10:29 +02:00
Mikołaj Sielużycki
6f1b6da68a compile: Fix headers so that *-headers targets compile cleanly.
Closes #10273
2022-03-25 16:19:26 +02:00
Avi Kivity
fcb8d040e8 treewide: use Software Package Data Exchange (SPDX) license identifiers
Instead of lengthy blurbs, switch to single-line, machine-readable
standardized (https://spdx.dev) license identifiers. The Linux kernel
switched long ago, so there is strong precedent.

Three cases are handled: AGPL-only, Apache-only, and dual licensed.
For the latter case, I chose (AGPL-3.0-or-later and Apache-2.0),
reasoning that our changes are extensive enough to apply our license.

The changes we applied mechanically with a script, except to
licenses/README.md.

Closes #9937
2022-01-18 12:15:18 +01:00
Kamil Braun
c1db77fa61 test: raft: logical_timer: introduce sleep_until
Allows sleeping until a given time point arrives.
2021-12-07 11:22:51 +01:00
Kamil Braun
21b5a6d9f7 test: raft: logical_timer: handle immediate timeout
If the user calls `with_timeout` with a time point that's already been
reached, we return `timed_out_error` immediately.
2021-07-13 11:15:25 +02:00
Kamil Braun
ed8e9a564a test: raft: logical_timer: on timeout, return the original future in the exception
More specifically, return a future which is equivalent to the original
future (when the original future resolves, this future will contain its
result).

Thus we don't discard the future, the user gets it back.
Let them decide what to do with it.
2021-07-13 11:15:25 +02:00
Kamil Braun
c86ff1eb7c test: raft: logical_timer: add schedule member function
It allows scheduling the given function to be called at the given logical
time point.
2021-07-13 11:15:25 +02:00
Kamil Braun
cf0d503a92 test: raft: randomized_nemesis_test: move logical_timer to its own header 2021-07-13 11:15:25 +02:00