<commit_before>// Will be run if environment long_test=true

package ring

import (
	"fmt"
	"math"
	"os"
	"runtime/pprof"
	"testing"
	"time"
)

var RUN_LONG bool = false

func init() {
	if os.Getenv("long_test") == "true" {
		RUN_LONG = true
	}
}

func TestNewRingBuilder(t *testing.T) {
	if !RUN_LONG {
		return
	}
	f, err := os.Create("long_test.prof")
	if err != nil {
		t.Fatal(err)
	}
	pprof.StartCPUProfile(f)
	fmt.Println(" nodes inactive partitions bits capacity maxunder maxover seconds")
	for zones := int32(10); zones <= 200; {
		helperTestNewRingBuilder(t, zones)
		if zones < 100 {
			zones += 10
		} else {
			zones += 100
		}
	}
	pprof.StopCPUProfile()
}

func helperTestNewRingBuilder(t *testing.T, zones int32) {
	b := NewBuilder()
	b.SetReplicaCount(3)<commit_msg>Add note when the long_test is skipped<commit_after>// Will be run if environment long_test=true
// Takes about 2 minutes on my MacBook Pro Retina 15".

package ring

import (
	"fmt"
	"math"
	"os"
	"runtime/pprof"
	"testing"
	"time"
)

var RUN_LONG bool = false

func init() {
	if os.Getenv("long_test") == "true" {
		RUN_LONG = true
	}
}

func TestNewRingBuilder(t *testing.T) {
	if !RUN_LONG {
		t.Skip("skipping unless env long_test=true")
	}
	f, err := os.Create("long_test.prof")
	if err != nil {
		t.Fatal(err)
	}
	pprof.StartCPUProfile(f)
	fmt.Println(" nodes inactive partitions bits capacity maxunder maxover seconds")
	for zones := int32(10); zones <= 200; {
		helperTestNewRingBuilder(t, zones)
		if zones < 100 {
			zones += 10
		} else {
			zones += 100
		}
	}
	pprof.StopCPUProfile()
}

func helperTestNewRingBuilder(t *testing.T, zones int32) {
	b := NewBuilder()
	b.SetReplicaCount(3)
{'fraction_non_alphanumeric': 0.13555291319857313, 'fraction_numerical': 0.02318668252080856, 'mean_word_length': 3.822349570200573, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2699746', 'n_tokens_mistral': 720, 'n_tokens_neox': 652, 'n_words': 166}