diff --git a/github-sync-go/internal/worker/repository_process_resume_test.go b/github-sync-go/internal/worker/repository_process_resume_test.go index 3fae8a20d..796d8b8bb 100644 --- a/github-sync-go/internal/worker/repository_process_resume_test.go +++ b/github-sync-go/internal/worker/repository_process_resume_test.go @@ -376,10 +376,11 @@ func TestInteropProcessRepositoryPublicMultiSkill(t *testing.T) { if err != nil { t.Fatal(err) } - if task == nil || task.PlatformControlVersion == nil || task.TaskID != os.Getenv("SKILLHUB_INTEROP_TASK_ID") || + // Java creates a TEAM source here; platform pause epochs apply only to @github. + if task == nil || task.PlatformControlVersion != nil || task.TaskID != os.Getenv("SKILLHUB_INTEROP_TASK_ID") || task.Repository == nil || task.Repository.RepositoryID != repositoryID || task.Repository.FixedCommitSHA != commitSHA || task.Mode != "FULL" { - t.Fatal("Java did not lease the expected fixed-commit repository task") + t.Fatal("Java did not lease the expected TEAM repository task without platform control") } if allTree && (task.MaxFilesPerPackage != 100 || task.MaxPackageBytes != 100<<20 || task.MaxUploadBytes != 100<<20) { diff --git a/server/skillhub-app/src/test/java/com/iflytek/skillhub/controller/GithubSyncHttpIngestionInteropTest.java b/server/skillhub-app/src/test/java/com/iflytek/skillhub/controller/GithubSyncHttpIngestionInteropTest.java index 34f380f94..345ad5a21 100644 --- a/server/skillhub-app/src/test/java/com/iflytek/skillhub/controller/GithubSyncHttpIngestionInteropTest.java +++ b/server/skillhub-app/src/test/java/com/iflytek/skillhub/controller/GithubSyncHttpIngestionInteropTest.java @@ -1755,6 +1755,8 @@ class GithubSyncHttpIngestionInteropTest { @Test @EnabledIfEnvironmentVariable(named = "SKILLHUB_GITHUB_SYNC_LIVE_INTERRUPT_INTEROP", matches = "1") void repositoryWorkerResumesAfterSigtermBetweenReceiptAndAcknowledgement() throws Exception { + long repositoryId = "1".equals(System.getenv("SKILLHUB_GITHUB_SYNC_LIVE_WORKER_REAL_TREE")) + ? 1103643573L : 987654350L; String namespaceSlug = "interop-interrupted-" + UUID.randomUUID().toString().substring(0, 8); long namespaceId = jdbc.queryForObject(""" INSERT INTO namespace (slug, display_name, type) @@ -1769,10 +1771,10 @@ class GithubSyncHttpIngestionInteropTest { INSERT INTO github_source_binding (namespace_id, repository_id, owner_login, repository_name, visibility, next_check_at) - VALUES (?, 987654350, 'openai', 'skills', 'NAMESPACE_ONLY', + VALUES (?, ?, 'openai', 'skills', 'NAMESPACE_ONLY', CURRENT_TIMESTAMP + INTERVAL '1 day') RETURNING id - """, Long.class, namespaceId); - UUID taskId = createRepositoryTask(namespaceId, sourceId, 987654350L); + """, Long.class, namespaceId, repositoryId); + UUID taskId = createRepositoryTask(namespaceId, sourceId, repositoryId); Path tempRoot = Files.createTempDirectory("skillhub-github-interrupted-"); try { ProcessBuilder builder = publicMultiSkillWorkerBuilder(taskId, false); @@ -3070,7 +3072,10 @@ class GithubSyncHttpIngestionInteropTest { } private void awaitVersionStatus(Long versionId, String expected) throws InterruptedException { - long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(15); + // The opt-in external scanner does real analysis and may queue requests; + // the local HTTP fixture should still finish within the short budget. + long timeoutSeconds = scanner == null ? 180 : 15; + long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(timeoutSeconds); String actual; do { actual = jdbc.queryForObject("SELECT status FROM skill_version WHERE id = ?", @@ -3080,7 +3085,8 @@ class GithubSyncHttpIngestionInteropTest { } Thread.sleep(100); } while (System.nanoTime() < deadline); - assertThat(actual).isEqualTo(expected); + assertThat(actual).as("version %s status after %s seconds", versionId, timeoutSeconds) + .isEqualTo(expected); } private String baseUrl() {