<commit_before>package org.kohsuke.github;

import org.apache.commons.io.IOUtils;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.dircache.DirCache;
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
import org.junit.Test;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.Properties;

public class LifecycleTest extends AbstractGitHubApiTestBase {
    @Test
    public void testCreateRepository() throws IOException, GitAPIException, InterruptedException {
        GHMyself myself = gitHub.getMyself();
        GHRepository repository = myself.getRepository("github-api-test");
        if (repository != null) {
            repository.delete();
            Thread.sleep(1000);
        }
        repository = gitHub.createRepository("github-api-test",
                "a test repository used to test kohsuke's github-api", "http://github-api.kohsuke.org/", true);

        assertTrue(repository.getReleases().isEmpty());
        try {
            GHMilestone milestone = repository.createMilestone("Initial Release", "first one");
            GHIssue issue = repository.createIssue("Test Issue")
                    .body("issue body just for grins")
                    .milestone(milestone)
                    .assignee(myself)
                    .label("bug")
                    .create();
            File repoDir = new File(System.getProperty("java.io.tmpdir"), "github-api-test");
            delete(repoDir);
            Git origin = Git.cloneRepository()
                    .setBare(false)
                    .setURI(repository.gitHttpTransportUrl())
                    .setDirectory(repoDir)
                    .setCredentialsProvider(getCredentialsProvider(myself))
                    .call();

            commitTestFile(myself, repoDir, origin);


            GHRelease release = createRelease(repository);

            GHAsset asset = uploadAsset(release);

            updateAsset(release, asset);

            deleteAsset(release, asset);<commit_msg>This test seems to fail randomly<commit_after>package org.kohsuke.github;

import org.apache.commons.io.IOUtils;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.dircache.DirCache;
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
import org.junit.Test;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.Properties;

public class LifecycleTest extends AbstractGitHubApiTestBase {
    @Test
    public void testCreateRepository() throws IOException, GitAPIException, InterruptedException {
        GHMyself myself = gitHub.getMyself();
        GHRepository repository = myself.getRepository("github-api-test");
        if (repository != null) {
            repository.delete();
            Thread.sleep(1000);
        }
        repository = gitHub.createRepository("github-api-test",
                "a test repository used to test kohsuke's github-api", "http://github-api.kohsuke.org/", true);
        Thread.sleep(1000); // wait for the repository to become ready

        assertTrue(repository.getReleases().isEmpty());
        try {
            GHMilestone milestone = repository.createMilestone("Initial Release", "first one");
            GHIssue issue = repository.createIssue("Test Issue")
                    .body("issue body just for grins")
                    .milestone(milestone)
                    .assignee(myself)
                    .label("bug")
                    .create();
            File repoDir = new File(System.getProperty("java.io.tmpdir"), "github-api-test");
            delete(repoDir);
            Git origin = Git.cloneRepository()
                    .setBare(false)
                    .setURI(repository.gitHttpTransportUrl())
                    .setDirectory(repoDir)
                    .setCredentialsProvider(getCredentialsProvider(myself))
                    .call();

            commitTestFile(myself, repoDir, origin);


            GHRelease release = createRelease(repository);

            GHAsset asset = uploadAsset(release);

            updateAsset(release, asset);

            deleteAsset(release, asset);
{'fraction_non_alphanumeric': 0.10332434860736747, 'fraction_numerical': 0.0026954177897574125, 'mean_word_length': 2.430662557781202, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2136188', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1135, 'n_words': 236}