Selaa lähdekoodia

chore: fix race condition in tests

jamesread 5 päivää sitten
vanhempi
commit
c5cd5295b0
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      service/internal/api/api_log_arguments_test.go

+ 6 - 0
service/internal/api/api_log_arguments_test.go

@@ -64,6 +64,8 @@ func TestExecutionStatusIncludesStoredArguments(t *testing.T) {
 	}))
 	require.NoError(t, err)
 
+	waitForLogArguments(t, ex, startResp.Msg.ExecutionTrackingId)
+
 	statusResp, err := client.ExecutionStatus(context.Background(), connect.NewRequest(&apiv1.ExecutionStatusRequest{
 		ExecutionTrackingId: startResp.Msg.ExecutionTrackingId,
 	}))
@@ -105,6 +107,8 @@ func TestExecutionStatusOmitsPasswordArguments(t *testing.T) {
 	}))
 	require.NoError(t, err)
 
+	waitForLogArguments(t, ex, startResp.Msg.ExecutionTrackingId)
+
 	statusResp, err := client.ExecutionStatus(context.Background(), connect.NewRequest(&apiv1.ExecutionStatusRequest{
 		ExecutionTrackingId: startResp.Msg.ExecutionTrackingId,
 	}))
@@ -356,6 +360,8 @@ func TestGetLogsIncludesStoredArguments(t *testing.T) {
 	require.NoError(t, err)
 	require.NotEmpty(t, startResp.Msg.ExecutionTrackingId)
 
+	waitForLogArguments(t, ex, startResp.Msg.ExecutionTrackingId)
+
 	logsResp, err := client.GetLogs(context.Background(), connect.NewRequest(&apiv1.GetLogsRequest{}))
 	require.NoError(t, err)
 	require.NotEmpty(t, logsResp.Msg.Logs)