Add actions for building and testing (#8)

* Add a Github action for building and testing

On Windows, -- -//third_party/... doesn't seem to work, so add all test directories manually. Also run the tests_*. We run only fastbuild tests here, since the opt tests will be run in the release workflow.

Also fix a number of compilation and test issues found along the way.
This commit is contained in:
Lutz Justen
2022-11-21 23:22:09 +01:00
committed by GitHub
parent bccc025945
commit 0252d51cc0
13 changed files with 151 additions and 28 deletions
+9 -3
View File
@@ -105,6 +105,9 @@ class DataProvider : public DataStoreReader {
// Periodically cleans up data in |writer_|.
void CleanupThreadMain() ABSL_LOCKS_EXCLUDED(shutdown_mutex_, cleaned_mutex_);
// Returns the current time of |steady_clock_| in seconds.
int64_t GetSteadyNowSec();
static constexpr unsigned int kNumberOfMutexes = 256;
// How much additional data to prefetch when a max. FUSE read is encountered.
@@ -124,15 +127,18 @@ class DataProvider : public DataStoreReader {
// Indicates whether the shutdown was triggered.
bool shutdown_ ABSL_GUARDED_BY(shutdown_mutex_) = false;
// The last access time.
std::atomic<std::chrono::time_point<std::chrono::steady_clock>>
last_access_ts_;
// The last access time in seconds since construction. Note that for some
// compilers we can't use std::chrono::time_point with atomics, so keep the
// time in seconds.
std::atomic<int64_t> last_access_sec_;
// Identifies if new data was added to the cache since the last cleanup.
std::atomic<bool> chunks_updated_;
// Clock to track the last access time.
SteadyClock* steady_clock_ = DefaultSteadyClock::GetInstance();
const std::chrono::time_point<std::chrono::steady_clock> first_now_ =
steady_clock_->Now();
// Cleanup interval.
uint32_t cleanup_timeout_sec_ = kCleanupTimeoutSec;