Skip to content

Commit 997f58e

Browse files
committed
fix query
1 parent 520052b commit 997f58e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

ci/jobs/scripts/job_hooks/build_profile_hook.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from ci.jobs.scripts.log_cluster import LogClusterBuildProfileQueries
66
from ci.praktika.info import Info
77
from ci.praktika.result import Result
8-
from ci.praktika.utils import Shell
8+
from ci.praktika.utils import Shell, Utils
99

1010
temp_dir = "./ci/tmp"
1111
build_dir = "./ci/tmp/build"
@@ -31,7 +31,9 @@ def check():
3131
):
3232
with open(profile_source, "rb") as ps_fd:
3333
profile_fd.write(ps_fd.read())
34-
check_start_time = Result.from_fs(Info().job_name)
34+
check_start_time = Utils.timestamp_to_str(
35+
Result.from_fs(Info().job_name).start_time
36+
)
3537
build_type = Info().job_name.split("(")[1].rstrip(")")
3638
assert build_type
3739
LogClusterBuildProfileQueries().insert_profile_data(
@@ -50,10 +52,13 @@ def check():
5052
file=profiles_dir / "binary_symbols.txt",
5153
)
5254
except Exception as e:
55+
print(f"ERROR: Failed to upload build profile data:")
5356
traceback.print_exc()
54-
print(f"ERROR: Failed to upload build profile data. ex: [{e}]")
5557
sys.exit(1)
5658

5759

5860
if __name__ == "__main__":
59-
check()
61+
if Info().pr_number == 0:
62+
check()
63+
else:
64+
print("Not applicable for PRs")

ci/jobs/scripts/log_cluster.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,17 @@ def __init__(self):
123123
def insert_profile_data(self, build_name, start_time, file):
124124
query = self._profile_query(build_name, start_time)
125125
with open(file, "rb") as data_fd:
126-
assert self._log_cluster.do_query(query, data=data_fd, timeout=20)
126+
assert self._log_cluster.do_query(query, data=data_fd, timeout=50)
127127

128128
def insert_build_size_data(self, build_name, start_time, file):
129129
query = self._build_size_query(build_name, start_time)
130130
with open(file, "rb") as data_fd:
131-
assert self._log_cluster.do_query(query, data=data_fd, timeout=20)
131+
assert self._log_cluster.do_query(query, data=data_fd, timeout=50)
132132

133133
def insert_binary_symbol_data(self, build_name, start_time, file):
134134
query = self._binary_symbol_query(build_name, start_time)
135135
with open(file, "rb") as data_fd:
136-
assert self._log_cluster.do_query(query, data=data_fd, timeout=20)
136+
assert self._log_cluster.do_query(query, data=data_fd, timeout=50)
137137

138138
def _profile_query(self, build_name, start_time):
139139
return f"""INSERT INTO build_time_trace

0 commit comments

Comments
 (0)