Skip to content

Commit

Permalink
xuxa2
Browse files Browse the repository at this point in the history
  • Loading branch information
jwendell committed Oct 31, 2022
1 parent 68bb021 commit d14c971
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
25 changes: 13 additions & 12 deletions maistra/run-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,29 @@ export BUILD_SCM_REVISION="Maistra PR #${PULL_NUMBER:-undefined}"
export BUILD_SCM_STATUS="SHA=${PULL_PULL_SHA:-undefined}"

# Build
time bazel build \
${COMMON_FLAGS} \
//source/exe:envoy-static
# time bazel build \
# ${COMMON_FLAGS} \
# //source/exe:envoy-static

echo "Build succeeded. Binary generated:"
bazel-bin/source/exe/envoy-static --version
# echo "Build succeeded. Binary generated:"
# bazel-bin/source/exe/envoy-static --version

# By default, `bazel test` command performs simultaneous
# build and test activity.
# The following build step helps reduce resources usage
# by compiling tests first.
# Build tests
time bazel build \
${COMMON_FLAGS} \
--build_tests_only \
//test/...\
-//test/server:listener_manager_impl_quic_only_test
# time bazel build \
# ${COMMON_FLAGS} \
# --build_tests_only \
# //test/...\
# -//test/server:listener_manager_impl_quic_only_test


# Run tests
time bazel test \
${COMMON_FLAGS} \
--build_tests_only \
//test/...
-//test/server:listener_manager_impl_quic_only_test
--test_output=all \
//test/extensions/common/async_files:async_file_handle_thread_pool_test \
--test_arg="--gtest_filter=*LinkCreatesNamedFile*"
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ class ActionCreateHardLink : public AsyncFileActionThreadPool<absl::Status> {
absl::Status executeImpl() override {
ASSERT(fileDescriptor() != -1);
std::string procfile = absl::StrCat("/proc/self/fd/", fileDescriptor());
std::cout << "PROCFILE = " << procfile << std::endl;
std::cout << "FILENAME = " << filename_ << std::endl;
auto result = posix().linkat(fileDescriptor(), procfile.c_str(), AT_FDCWD, filename_.c_str(),
AT_SYMLINK_FOLLOW);
if (result.return_value_ == -1) {
std::cout << "ERROR = " << Envoy::errorDetails(result.errno_) << std::endl;
return statusAfterFileError(result);
}
return absl::OkStatus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,19 @@ TEST_F(AsyncFileHandleTest, LinkCreatesNamedFile) {
ASSERT_NE(-1, fd);
posix.close(fd);
// Delete the file so we're where we would have been with `mktemp`!
posix.unlink(filename);
fd = posix.unlink(filename).return_value_;
ASSERT_NE(-1, fd);

// Link the anonymous file into our tmp file name.
std::promise<absl::Status> link_status;
std::cout << "Linking as " << filename << std::endl;

EXPECT_OK(handle->createHardLink(std::string(filename),
[&](absl::Status status) { link_status.set_value(status); }));
ASSERT_OK(link_status.get_future().get());
auto res = link_status.get_future().get();
std::cout << "CODE = " << res.code() << std::endl;
ASSERT_OK(res);
//ASSERT_OK(link_status.get_future().get());
// Read the contents of the linked file back, raw.
char fileContents[6];
fileContents[5] = '\0';
Expand Down

0 comments on commit d14c971

Please sign in to comment.