Skip to content

Commit 3e98561

Browse files
committed
修bug
1 parent 4808fe5 commit 3e98561

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/maven.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
echo "Starting Java Server..."
128128
echo "Provider protocol override: rpc.protocol=grpc"
129129
# Run in background with nohup
130-
nohup java -Drpc.protocol=grpc -cp "$CLASSPATH" com.xiaoyu.rpc.provider.ProviderApp > server.log 2>&1 &
130+
nohup java -Dlogback.configurationFile=rpc-core/src/main/resources/logback.xml -Drpc.protocol=grpc -cp "$CLASSPATH" com.xiaoyu.rpc.provider.ProviderApp > server.log 2>&1 &
131131
132132
# Wait for server port 8080 to be available
133133
echo "Waiting for Java Server to start on port 8080..."
@@ -158,31 +158,34 @@ jobs:
158158
159159
run_java() {
160160
echo "Running Java Client (grpc)..."
161-
if java -Drpc.protocol=grpc -Drpc.serializer=protobuf -cp "$CLASSPATH" com.xiaoyu.rpc.consumer.ConsumerApp | tee java-client.log \
161+
if timeout 120s java -Dlogback.configurationFile=rpc-core/src/main/resources/logback.xml -Drpc.protocol=grpc -Drpc.serializer=protobuf -cp "$CLASSPATH" com.xiaoyu.rpc.consumer.ConsumerApp | tee java-client.log \
162162
&& grep -q "Result1:" java-client.log \
163163
&& grep -q "Result2:" java-client.log; then
164164
echo "PASS" > .ci-status/java.status
165165
else
166+
echo "Java client chain failed or timed out."
166167
echo "FAIL" > .ci-status/java.status
167168
fi
168169
}
169170
170171
run_python() {
171172
echo "Running Python Client..."
172-
if (cd python_client && python client.py) | tee python-client.log \
173+
if timeout 120s bash -c 'cd python_client && python client.py' | tee python-client.log \
173174
&& grep -q "Message: Success" python-client.log; then
174175
echo "PASS" > .ci-status/python.status
175176
else
177+
echo "Python client chain failed or timed out."
176178
echo "FAIL" > .ci-status/python.status
177179
fi
178180
}
179181
180182
run_go() {
181183
echo "Running Go Client..."
182-
if (cd go_client && go run main.go) | tee go-client.log \
184+
if timeout 120s bash -c 'cd go_client && go run main.go' | tee go-client.log \
183185
&& grep -q "Message: Success" go-client.log; then
184186
echo "PASS" > .ci-status/go.status
185187
else
188+
echo "Go client chain failed or timed out."
186189
echo "FAIL" > .ci-status/go.status
187190
fi
188191
}

0 commit comments

Comments
 (0)